1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-23 22:08:05 +11:00
collapseos/blk/383

17 lines
385 B
Plaintext
Raw Normal View History

: _
2020-05-13 23:02:44 +10:00
999 SWAP ( stop indicator )
BEGIN
?DUP NOT IF EXIT THEN
2020-05-13 23:02:44 +10:00
10 /MOD ( r q )
SWAP '0' + SWAP ( d q )
AGAIN ;
: . ( n -- )
?DUP NOT IF '0' EMIT EXIT THEN ( 0 is a special case )
2020-05-13 23:02:44 +10:00
( handle negative )
DUP 0< IF '-' EMIT -1 * THEN
_
BEGIN
DUP '9' > IF DROP EXIT THEN ( stop indicator )
EMIT
AGAIN ;