: do1 ( nn-) do 0
i 3 mod 0= if ." fizz" 1+ then
i 5 mod 0= if ." buzz" 1+ then
if space else i . then loop ;
: ?type ( faunn-f)
mod if 2drop else type 1+ then ;
: do2 ( nn-) do 0
s" fizz" i 3 ?type
s" buzz" i 5 ?type
if space else i . then loop ;
: -> ( fnn-f) mod if rdrop else 1+ then ;
: fizz ( fn-f) 3 -> ." fizz" ;
: buzz ( fn-f) 5 -> ." buzz" ;
: rest ( nf-) if drop space else . then ;
: do3 ( nn-) do i 0 i fizz i buzz rest loop ;
: "u" ( u-au) 0 <# #s #> ;
: type+ ( wau-w) tuck type + ;
: do4 ( nn-) do
9 0 ( width written )
i 3 mod 0= if s" fizz" type+ then
i 5 mod 0= if s" buzz" type+ then
dup 0= if i "u" type+ then
- spaces loop ;
cr cr 31 1 do1
cr cr 31 1 do2
cr cr 31 1 do3
cr cr 31 1 do4
CjogZG8xICggbm4tKSBkbyAwCiAgaSAzIG1vZCAwPSBpZiAuIiBmaXp6IiAxKyB0aGVuCiAgaSA1IG1vZCAwPSBpZiAuIiBidXp6IiAxKyB0aGVuCiAgaWYgc3BhY2UgZWxzZSBpIC4gdGhlbiBsb29wIDsKCjogP3R5cGUgKCBmYXVubi1mKQogIG1vZCBpZiAyZHJvcCBlbHNlIHR5cGUgMSsgdGhlbiA7CjogZG8yICggbm4tKSBkbyAwCiAgcyIgZml6eiIgaSAzID90eXBlCiAgcyIgYnV6eiIgaSA1ID90eXBlCiAgaWYgc3BhY2UgZWxzZSBpIC4gdGhlbiBsb29wIDsKCjogLT4gKCBmbm4tZikgbW9kIGlmIHJkcm9wIGVsc2UgMSsgdGhlbiA7CjogZml6eiAoIGZuLWYpIDMgLT4gLiIgZml6eiIgOwo6IGJ1enogKCBmbi1mKSA1IC0+IC4iIGJ1enoiIDsKOiByZXN0ICggbmYtKSBpZiBkcm9wIHNwYWNlIGVsc2UgLiB0aGVuIDsKOiBkbzMgKCBubi0pIGRvIGkgMCBpIGZpenogaSBidXp6IHJlc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