Non-decimal radices/Output: Difference between revisions

Added Kotlin
(Added Kotlin)
Line 712:
101011 53 43 2b
101111 57 47 2f
</pre>
 
=={{header|Kotlin}}==
<lang scala>// version 1.1.2
 
fun main(args: Array<String>) {
val bases = intArrayOf(2, 8, 10, 16, 19, 36)
for (base in bases) print("%6s".format(base))
println()
println("-".repeat(6 * bases.size))
for (i in 0..35) {
for (base in bases) print("%6s".format(i.toString(base)))
println()
}
}</lang>
 
{{out}}
<pre>
2 8 10 16 19 36
------------------------------------
0 0 0 0 0 0
1 1 1 1 1 1
10 2 2 2 2 2
11 3 3 3 3 3
100 4 4 4 4 4
101 5 5 5 5 5
110 6 6 6 6 6
111 7 7 7 7 7
1000 10 8 8 8 8
1001 11 9 9 9 9
1010 12 10 a a a
1011 13 11 b b b
1100 14 12 c c c
1101 15 13 d d d
1110 16 14 e e e
1111 17 15 f f f
10000 20 16 10 g g
10001 21 17 11 h h
10010 22 18 12 i i
10011 23 19 13 10 j
10100 24 20 14 11 k
10101 25 21 15 12 l
10110 26 22 16 13 m
10111 27 23 17 14 n
11000 30 24 18 15 o
11001 31 25 19 16 p
11010 32 26 1a 17 q
11011 33 27 1b 18 r
11100 34 28 1c 19 s
11101 35 29 1d 1a t
11110 36 30 1e 1b u
11111 37 31 1f 1c v
100000 40 32 20 1d w
100001 41 33 21 1e x
100010 42 34 22 1f y
100011 43 35 23 1g z
</pre>
 
9,482

edits