1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-27 19:08:06 +11:00
collapseos/blk/357
2020-10-28 20:29:28 -04:00

8 lines
238 B
Plaintext

( r c -- r f )
( Parse digit c and accumulate into result r.
Flag f is true when c was a valid digit )
: _pdacc
'0' - DUP 10 < IF ( good, add to running result )
SWAP 10 * + 1 ( r*10+n f )
ELSE ( bad ) DROP 0 THEN ;