fork download
  1.  
  2. : do1 ( nn-) do 0
  3. i 3 mod 0= if ." fizz" 1+ then
  4. i 5 mod 0= if ." buzz" 1+ then
  5. if space else i . then loop ;
  6.  
  7. : ?type ( faunn-f)
  8. mod if 2drop else type 1+ then ;
  9. : do2 ( nn-) do 0
  10. s" fizz" i 3 ?type
  11. s" buzz" i 5 ?type
  12. if space else i . then loop ;
  13.  
  14. : -> ( fnn-f) mod if rdrop else 1+ then ;
  15. : fizz ( fn-f) 3 -> ." fizz" ;
  16. : buzz ( fn-f) 5 -> ." buzz" ;
  17. : rest ( nf-) if drop space else . then ;
  18. : do3 ( nn-) do i 0 i fizz i buzz rest loop ;
  19.  
  20. : "u" ( u-au) 0 <# #s #> ;
  21. : type+ ( wau-w) tuck type + ;
  22. : do4 ( nn-) do
  23. 9 0 ( width written )
  24. i 3 mod 0= if s" fizz" type+ then
  25. i 5 mod 0= if s" buzz" type+ then
  26. dup 0= if i "u" type+ then
  27. - spaces loop ;
  28.  
  29. cr cr 31 1 do1
  30. cr cr 31 1 do2
  31. cr cr 31 1 do3
  32. cr cr 31 1 do4
  33.  
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout

1 2 fizz 4 buzz fizz 7 8 fizz buzz 11 fizz 13 14 fizzbuzz 16 17 fizz 19 buzz fizz 22 23 fizz buzz 26 fizz 28 29 fizzbuzz 

1 2 fizz 4 buzz fizz 7 8 fizz buzz 11 fizz 13 14 fizzbuzz 16 17 fizz 19 buzz fizz 22 23 fizz buzz 26 fizz 28 29 fizzbuzz 

1 2 fizz 4 buzz fizz 7 8 fizz buzz 11 fizz 13 14 fizzbuzz 16 17 fizz 19 buzz fizz 22 23 fizz buzz 26 fizz 28 29 fizzbuzz 

1        2        fizz     4        buzz     fizz     7        8        fizz     buzz     11       fizz     13       14       fizzbuzz 16       17       fizz     19       buzz     fizz     22       23       fizz     buzz     26       fizz     28       29       fizzbuzz