Created
October 12, 2019 14:56
-
-
Save tjwds/d465b1b1f1edc98b96cf5f852c1d2952 to your computer and use it in GitHub Desktop.
fizzbuzz in FORTH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
: FIZZBUZZ (n -- ) | |
0 DO | |
I 1 + 15 MOD 0 = IF | |
." fizzbuzz " CR ELSE | |
I 1 + 5 MOD 0 = IF | |
." buzz " CR ELSE | |
I 1 + 3 MOD 0 = IF | |
." fizz " CR ELSE | |
I 1 + . CR | |
THEN THEN THEN LOOP ; | |
100 FIZZBUZZ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment