Anonymous user
Write language name in 3D ASCII: Difference between revisions
→{{header|Scala}}
m (added C output) |
|||
Line 1,778:
===Idiomatic===
Cleaner code.
<lang scala>
object Ascii3D extends App {
def ASCII3D = {
val
** ** * * *
* * * * * * *
Line 1,793 ⟶ 1,795:
var arr = {
val (x, y) = // Get maximal format and create a 2-D array with it.
(
}
Line 1,800 ⟶ 1,802:
// Map asterisks to 3D cube
//
val (cubeTop, cubeBottom) = ("""///\""", """\\\/""")
for {
y <- 0 until
x <- 0 until
if
indent =
} {
arr(y) = arr(y) patch ((x * 3 + indent), cubeTop, cubeTop.size)
|