mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-29 00:58:06 +11:00
12 lines
218 B
Plaintext
12 lines
218 B
Plaintext
( returns negative value on error )
|
|
: _ ( c -- n )
|
|
( '0' is ASCII 48 )
|
|
48 -
|
|
DUP 0< IF EXIT THEN ( bad )
|
|
DUP 2 < IF EXIT THEN ( good )
|
|
( bad )
|
|
255 -
|
|
;
|
|
|
|
|