1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-26 15:18:06 +11:00
collapseos/blk/447

15 lines
319 B
Plaintext
Raw Normal View History

2020-04-26 11:54:07 +10:00
( returns negative value on error )
: _ ( c -- n )
( '0' is ASCII 48 )
48 -
2020-05-03 10:32:20 +10:00
DUP 0< ( bad ) OVER 10 < ( good ) OR IF EXIT THEN
2020-04-26 11:54:07 +10:00
( 'a' is ASCII 97. 59 = 97 - 48 )
49 -
DUP 0< IF EXIT THEN ( bad )
DUP 6 < IF 10 + EXIT THEN ( good )
( bad )
255 -
;