Upside-down numbers: Difference between revisions

A
(add freebasic)
(A)
Line 1,076:
Five millionth: 82,485,246,852,682
</pre>
 
=={{header|Quackery}}==
 
<syntaxhighlight lang="Quackery"> [ 1
[ 2dup > while
2 / 1+ 18 * 1+
again ]
nip ] is necessary ( n --> n )
 
[ [] swap
witheach
[ ' [ [ char 1 char 9 ]
[ char 2 char 8 ]
[ char 3 char 7 ]
[ char 4 char 6 ]
[ char 5 char 5 ]
[ char 6 char 4 ]
[ char 7 char 3 ]
[ char 8 char 2 ]
[ char 9 char 1 ] ]
witheach
[ over dip do
dip swap join
swap join nested
rot swap join
swap ]
drop ] ] is expand ( [ --> [ )
 
[ dup necessary temp put
' [ [ char 5 ] ]
' [ [ ] [ char 5 ] ]
[ expand tuck join swap
over size
temp share < not
until ]
drop
temp release
[] swap
witheach
[ $->n drop join ]
sort
swap split drop ] is upsidedowns ( n --> [ )
 
5000 upsidedowns
say "First 50 upside down numbers:"
dup 50 split drop
[] swap witheach
[ number$ nested join ]
45 wrap$
cr cr
say "500th upside down number: "
dup 499 peek echo
cr
say "5000th upside down number: "
4999 peek echo</syntaxhighlight>
 
{{out}}
 
<pre>First 50 upside down numbers:
5 19 28 37 46 55 64 73 82 91 159 258 357 456
555 654 753 852 951 1199 1289 1379 1469 1559
1649 1739 1829 1919 2198 2288 2378 2468 2558
2648 2738 2828 2918 3197 3287 3377 3467 3557
3647 3737 3827 3917 4196 4286 4376 4466
 
500th upside down number: 494616
5000th upside down number: 56546545</pre>
 
=={{header|Raku}}==
1,462

edits