Non-decimal radices/Output: Difference between revisions

m
→‎{{header|Haskell}}: (added a further radix (32) to the test)
(→‎{{header|Haskell}}: (used Array Int Char for digits, rather than [Char]))
m (→‎{{header|Haskell}}: (added a further radix (32) to the test))
Line 578:
-- ARBITRARY RADICES ----------------------------------------------------------
bases :: [Int]
bases = abs <$> [2, 7, 8, 10, 12, 16, 32]
 
tableRows :: [[String]]
Line 617:
(table " " (([(show <$>), (const "----" <$>)] <*> [bases]) <> tableRows))</lang>
{{Out}}
<pre> 2 7 8 10 12 16 32
---- ---- ---- ---- ---- ---- ----
1 1 1 1 1 1 1
10 2 2 2 2 2 2
11 3 3 3 3 3 3
100 4 4 4 4 4 4
101 5 5 5 5 5 5
110 6 6 6 6 6 6
111 10 7 7 7 7 7
1000 11 10 8 8 8 8
1001 12 11 9 9 9 9
1010 13 12 10 A A A
1011 14 13 11 B B B
1100 15 14 12 10 C C
1101 16 15 13 11 D D
1110 20 16 14 12 E E
1111 21 17 15 13 F F
10000 22 20 16 14 10 G
10001 23 21 17 15 11 H
10010 24 22 18 16 12 I
10011 25 23 19 17 13 J
10100 26 24 20 18 14 K
10101 30 25 21 19 15 L
10110 31 26 22 1A 16 M
10111 32 27 23 1B 17 N
11000 33 30 24 20 18 O
11001 34 31 25 21 19 P
11010 35 32 26 22 1A Q
11011 36 33 27 23 1B R
11100 40 34 28 24 1C S
11101 41 35 29 25 1D T
11110 42 36 30 26 1E U
11111 43 37 31 27 1F V
100000 44 40 32 28 20 10
100001 45 41 33 29 21 11</pre>
 
=={{header|HicEst}}==
9,655

edits