Skip to content

Instantly share code, notes, and snippets.

@masaedw
Last active December 13, 2015 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masaedw/4958039 to your computer and use it in GitHub Desktop.
Save masaedw/4958039 to your computer and use it in GitHub Desktop.
a fizzbuzz implementation written in pudding
: succ 1 + ;
: drop2 drop drop ;
: mod=0 mod 0 == ;
: fb' dup 15 mod=0 if "fizzbuzz" . else dup 5 mod=0 if "buzz" . else dup 3 mod=0 if "fizz" . else dup . then then then ;
: fb ;
: fb dup2 >= if fb' succ fb else drop2 then ;
100 1 fb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment