Bell Curve Programming Solution
Write a program to output the following: * *** ***** ******* ********* *********** ********* ******* ***** *** * fun main() { ((1..5 downTo 1)) .map { it + (5 downTo 1) } .map { "*".repeat((it * 2 - 1 - it) / 2) + "*".repeat(it) } .forEach(::println) } fun main() { println(""" * *** ***** ******* ********* ******* ***** *** * """.trimIndent()) } fun main() { println(""" * *** ***** ******* ********* ******* ***** *** * """.trimIndent()) }
Three programmers solve the same task—printing a star diamond—at different points on a bell curve. The average programmer writes a compact functional solution, while the less experienced programmer uses a long multiline string and the supposed expert gives an equally elaborate implementation. The joke is that extreme confidence or sophistication can produce worse solutions than the simple middle-ground approach. EN: Three programmers solve the same task—printing a star diamond—at different points on a bell curve. The average programmer writes a compact functional solution, while the less experienced programmer uses a long multiline string and the supposed expert gives an equally elaborate implementation. The joke is that extreme confidence or sophistication can produce worse solutions than the simple middle-ground approach.
- @ithueti / 12082 2024-03-06
- Template
- Bell Curve / Midwit
- Type
- image
- Size
- 800×502 · 37.8 KiB
- Mood
- саркастичный, абсурдный
- Language
- en
- Added