Jump to content

Esthetic numbers: Difference between revisions

Added Quackery.
m (syntax highlighting fixup automation)
(Added Quackery.)
Line 6,052:
123454543 123454545 123454565 123454567 123456543 123456545
123456565 123456567 123456765 123456767 123456787 123456789</pre>
 
=={{header|Quackery}}==
 
<syntaxhighlight lang="Quackery"> [ [] swap
[ base share /mod
rot join swap
dup 0 = until ]
drop ] is digits ( n --> [ )
 
[ dup 0 = iff
[ drop false ]
done
digits
true swap
behead swap
witheach
[ tuck - abs 1 != if
[ dip not conclude ] ]
drop ] is esthetic ( n --> b )
 
15 times
[ i^ 2 +
say "Base " dup echo cr
base put
[] 0
[ 1+
dup esthetic if
[ tuck join swap ]
over size
base share 6 * = until ]
drop
base share 4 * 1 - split nip
echo cr cr
base release ]
say "Decimal between 1000 and 9999: "
cr
0 temp put
9000 times
[ i^ 1000 + dup
esthetic iff
[ echo
1 temp tally
temp share
10 mod iff
sp else cr ]
else drop ]
temp release</syntaxhighlight>
 
{{out}}
 
<pre>Base 2
[ 10101010 101010101 1010101010 10101010101 101010101010 ]
 
Base 3
[ 1210 1212 2101 2121 10101 10121 12101 ]
 
Base 4
[ 323 1010 1012 1210 1212 1232 2101 2121 2123 ]
 
Base 5
[ 323 343 432 434 1010 1012 1210 1212 1232 1234 2101 ]
 
Base 6
[ 343 345 432 434 454 543 545 1010 1012 1210 1212 1232 1234 ]
 
Base 7
[ 345 432 434 454 456 543 545 565 654 656 1010 1012 1210 1212 1232 ]
 
Base 8
[ 432 434 454 456 543 545 565 567 654 656 676 765 767 1010 1012 1210 1212 ]
 
Base 9
[ 434 454 456 543 545 565 567 654 656 676 678 765 767 787 876 878 1010 1012 1210 ]
 
Base 10
[ 454 456 543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 987 989 1010 1012 ]
 
Base 11
[ 456 543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 89A 987 989 9A9 A98 A9A 1010 ]
 
Base 12
[ 543 545 565 567 654 656 676 678 765 767 787 789 876 878 898 89A 987 989 9A9 9AB A98 A9A ABA BA9 BAB ]
 
Base 13
[ 545 565 567 654 656 676 678 765 767 787 789 876 878 898 89A 987 989 9A9 9AB A98 A9A ABA ABC BA9 BAB BCB CBA ]
 
Base 14
[ 565 567 654 656 676 678 765 767 787 789 876 878 898 89A 987 989 9A9 9AB A98 A9A ABA ABC BA9 BAB BCB BCD CBA CBC CDC ]
 
Base 15
[ 567 654 656 676 678 765 767 787 789 876 878 898 89A 987 989 9A9 9AB A98 A9A ABA ABC BA9 BAB BCB BCD CBA CBC CDC CDE DCB DCD ]
 
Base 16
[ 654 656 676 678 765 767 787 789 876 878 898 89A 987 989 9A9 9AB A98 A9A ABA ABC BA9 BAB BCB BCD CBA CBC CDC CDE DCB DCD DED DEF EDC ]
 
Decimal between 1000 and 9999:
1010 1012 1210 1212 1232 1234 2101 2121 2123 2321
2323 2343 2345 3210 3212 3232 3234 3432 3434 3454
3456 4321 4323 4343 4345 4543 4545 4565 4567 5432
5434 5454 5456 5654 5656 5676 5678 6543 6545 6565
6567 6765 6767 6787 6789 7654 7656 7676 7678 7876
7878 7898 8765 8767 8787 8789 8987 8989 9876 9878
9898
</pre>
 
=={{header|Raku}}==
1,462

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.