Cistercian numerals: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (→{{header|Raku}}: add tag) |
(Added Quackery.) |
||
Line 4,270: | Line 4,270: | ||
The pre tag may have to shift from one monospace font to a second that contains a character missing from the first. Those two individually monospaced fonts may have differing character widths between fonts (although consistent within individual monospaced fonts).<br> |
The pre tag may have to shift from one monospace font to a second that contains a character missing from the first. Those two individually monospaced fonts may have differing character widths between fonts (although consistent within individual monospaced fonts).<br> |
||
Paste the output into a monospace code editor and the stems of each number might well align! |
Paste the output into a monospace code editor and the stems of each number might well align! |
||
=={{header|Quackery}}== |
|||
<syntaxhighlight lang="Quackery"> [ $ "turtleduck.qky" loadfile ] now! |
|||
[ [ 50 dup * 2 * 1 |
|||
10 vsqrt drop |
|||
join ] constant |
|||
do ] is diag ( --> n/d ) |
|||
[ stack 1 ] is side ( --> s ) |
|||
[ 0 side take |
|||
- side put ] is otherside ( --> ) |
|||
[ 150 1 walk |
|||
-150 1 fly ] is trunk ( --> ) |
|||
[ 50 1 fly ] is inset ( --> ) |
|||
[ -50 1 fly ] is outset ( --> ) |
|||
[ 150 1 fly |
|||
1 2 turn ] is otherend ( --> ) |
|||
[ ] is zero ( --> ) |
|||
[ -1 4 turn |
|||
50 side share * |
|||
dup 1 walk |
|||
negate 1 fly |
|||
1 4 turn ] is one ( --> ) |
|||
[ inset one outset ] is two ( --> ) |
|||
[ -1 side share * |
|||
8 turn |
|||
diag walk |
|||
diag -v fly |
|||
1 side share * |
|||
8 turn ] is three ( --> ) |
|||
[ inset |
|||
-3 side share * |
|||
8 turn |
|||
diag walk |
|||
diag -v fly |
|||
3 side share * |
|||
8 turn |
|||
outset ] is four ( --> ) |
|||
[ one four ] is five ( --> ) |
|||
[ 1 side share * |
|||
4 turn outset |
|||
one |
|||
inset |
|||
-1 side share * |
|||
4 turn ] is six ( --> ) |
|||
[ one six ] is seven ( --> ) |
|||
[ two six ] is eight ( --> ) |
|||
[ one two six ] is nine ( --> ) |
|||
[ [ table |
|||
zero one two |
|||
three four five |
|||
six seven eight |
|||
nine ] do ] is thousands ( n --> ) |
|||
[ otherend |
|||
thousands |
|||
otherend ] is units ( n --> ) |
|||
[ otherside |
|||
units |
|||
otherside ] is tens ( n --> ) |
|||
[ otherside |
|||
thousands |
|||
otherside ] is hundreds ( n --> ) |
|||
[ inset |
|||
-1 4 turn |
|||
trunk |
|||
' [ units tens |
|||
hundreds |
|||
thousands ] |
|||
witheach |
|||
[ dip |
|||
[ 10 /mod ] |
|||
do ] |
|||
drop |
|||
1 4 turn |
|||
outset ] is cistercian ( n --> ) |
|||
[ dup witheach |
|||
[ cistercian |
|||
3 times inset ] |
|||
size 3 * times |
|||
outset ] is task ( [ --> ) |
|||
turtle 5 wide -600 1 fly |
|||
' [ 0 1 20 300 4000 5555 6789 1234 ] task</syntaxhighlight> |
|||
{{out}} |
|||
[[File:Quackery Cistercian numerals.png|frameless|center]] |
|||
=={{header|Raku}}== |
=={{header|Raku}}== |
||
Handles 0 through 9999 only. No error trapping. If you feed it an unsupported number it will truncate to maximum 4 digits. |
Handles 0 through 9999 only. No error trapping. If you feed it an unsupported number it will truncate to maximum 4 digits. |