Skip to content

Instantly share code, notes, and snippets.

@spierceVR
Created August 21, 2022 21:39
Show Gist options
  • Save spierceVR/db9d5522f0998b450912631e9e2fef41 to your computer and use it in GitHub Desktop.
Save spierceVR/db9d5522f0998b450912631e9e2fef41 to your computer and use it in GitHub Desktop.
Pringle fizzbuzz
1 0 # set flag 1, set i 0
loop {
1 + # increment i
dup 3 % 0 = if { # if div by 3 print Fizz
"Fizz" print
swap pop 0 swap # set flag false
}
dup 5 % 0 = if { # if div by 5 print Buzz
"Buzz" print
swap pop 0 swap # set flag false
}
swap dup if { # if flag print
swap
dup print
swap
}
swap
"
" print
dup 100 = if {break}
swap pop 1 swap # set flag true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment