Download examples/forth/words.fs from Snapkitty/ai-free: direct link, hf CLI and curl.
- Browser
- Download file 243 Bytes
-
https://huggingface.co/Snapkitty/ai-free/resolve/main/examples/forth/words.fs
- Command line
-
hf download hf://Snapkitty/ai-free/examples/forth/words.fs
-
curl -L -o words.fs https://huggingface.co/Snapkitty/ai-free/resolve/main/examples/forth/words.fs
243 Bytes
| \ VARIABLE, CONSTANT, MOD, 0=, RECURSE and EXIT. Halts with 21 (gcd) and 1. | |
| 10 CONSTANT TEN | |
| VARIABLE RESULT | |
| : GCD ( a b -- g ) DUP 0= IF DROP EXIT THEN SWAP OVER MOD RECURSE ; | |
| 1071 462 GCD RESULT ! | |
| RESULT @ TEN 3 MOD 1 = IF 1 ELSE 0 THEN | |