# Pastebin GBpMKW0A ( Checks to see if an ascii character code is a digit ) ( chr -- true | false ) : LOOKS-LIKE-DIGIT ( Assuming we're working with ASCII and not something like EBCDIC, it should be safe to assume that numbers fall between 48: 0, and 57: 9. ) DUP 48 >= SWAP 57 <= -1 = = ; ( Checks to see if a string looks like a number ) ( addr len -- true | false ) : LOOKS-LIKE-NUMBER -1 SWAP 0 DO DROP ( Discard until last iteration ) DUP C@ ( Save address, fetch character ) LOOKS-LIKE-DIGIT INVERT IF ( Check to ensure this is a digit in ASCII ) 0 LEAVE ( gtfo ) THEN ( Not a digit ) 1+ -1 LOOP ( Might be a number ) SWAP DROP -1 = ;