Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

-1: Simplify the logic and thou shalt profit
Source Link
EasyasPi
  • 5.4k
  • 20
  • 23

Phooey, (削除) 53 48 (削除ここまで)4847 bytes

[100+1@@@%3[100+1@@@@%3{"Fizz">&1<"Fizz">&<}&%5{"Buzz">&<}>{&$i}"
"&]"]

Try it online! Try it online!

Outgolfed the creator at his own language. 😏


[100 while cell is not 100
 +1 increment cell
 @@@ @@@@ push threefour copies to the stack
 %3 set cell to cell mod 3
 { if cell is not zero
 "Fizz" print fizz
 >&1<>&< set fizzed flag pop value into the next cell to mark it
 } endif
 & pop original value from stack
 %5{"Buzz">&<} repeat for buzz but pop from> stack instead of just 1 move to the next cell
 >{ if fizzedneither flagfizz isor zerobuzz set the next cell
 & Pop to the cell
 $i print number
 } endif 
 "\n" print newline
 & Pop numberall frompaths stackpopped the value to this cell, loop
] end

The stack and tape are all filled with a lot of junk (as in ~200 numbers on the stack 100 items on the tape) and at the end since I don't consistently move the pointer or pop the same amount of times, but I don't care. 😏

I may make fun of the interpreter, but it is a pretty nice language.

  • -5 bytes: Use stack instead of tape, and don't restore the tape and stack
  • -1 byte: Simplify the logic to avoid the extra pop (in exchange for double the stack usage 😛).

Phooey, (削除) 53 (削除ここまで)48 bytes

[100+1@@@%3{"Fizz">&1<}&%5{"Buzz">&<}>{&$i}"
"&]

Try it online!

Outgolfed the creator at his own language. 😏


[100 while cell is not 100
 +1 increment cell
 @@@  push three copies to the stack
 %3 set cell to cell mod 3
 { if cell is not zero
 "Fizz" print fizz
 >&1< set fizzed flag
 } endif
 & pop original value from stack
 %5{"Buzz">&<} repeat for buzz but pop from stack instead of just 1
 >{ if fizzed flag is zero 
 & Pop
 $i print number
 } endif 
 "\n" print newline
 & Pop number from stack
] end

The stack and tape are all filled with junk at the end since I don't consistently move the pointer or pop the same amount of times, but I don't care. 😏

I may make fun of the interpreter, but it is a pretty nice language.

  • -5 bytes: Use stack instead of tape, and don't restore the tape and stack

Phooey, (削除) 53 48 (削除ここまで)47 bytes

[100+1@@@@%3{"Fizz">&<}&%5{"Buzz">&<}>{&$i}"
"]

Try it online!

Outgolfed the creator at his own language. 😏


[100 while cell is not 100
 +1 increment cell
 @@@@ push four copies to the stack
 %3 set cell to cell mod 3
 { if cell is not zero
 "Fizz" print fizz
 >&<  pop value into the next cell to mark it
 } endif
 & pop original value from stack
 %5{"Buzz">&<} repeat for buzz >  move to the next cell
 { if neither fizz or buzz set the next cell
 & Pop to the cell
 $i print number
 } endif 
 "\n" print newline
 all paths popped the value to this cell, loop
] end

The stack and tape are all filled with a lot of junk (as in ~200 numbers on the stack 100 items on the tape) and at the end since I don't consistently move the pointer or pop the same amount of times, but I don't care. 😏

I may make fun of the interpreter, but it is a pretty nice language.

  • -5 bytes: Use stack instead of tape, and don't restore the tape and stack
  • -1 byte: Simplify the logic to avoid the extra pop (in exchange for double the stack usage 😛).
Big improvement
Source Link
EasyasPi
  • 5.4k
  • 20
  • 23

Phooey, 53(削除) 53 (削除ここまで)48 bytes

[100+1>&<@@%3[100+1@@@%3{"Fizz">&1<}&%5{"Buzz">&1<"Buzz">&<}&>>{<$i>&$i}"
"<]"&]

Try it online! Try it online!

Outgolfed the creator at his own language. 😏


[100 while cell is not 100
 +1 increment cell
>&< set fizzed flag - empty stack is zero
 @@ @@@ push twothree copies to the stack
 %3 set cell to cell mod 3
 { if cell is not zero
 "Fizz" print fizz
>&1< set fizzed flag
 } endif
 & pop original value from stack
 %5{"Buzz">&1<"Buzz">&<} repeat for buzz but pop from stack instead of just 1
 &>{ if popfizzed againflag is zero 
 >{ & if fizzed flag is zero Pop
 <$i>$i  print number
 } endif 
 "\n" print newline
 < & return toPop number cellfrom stack
] end

The stack and tape are all filled with junk at the end since I don't consistently move the pointer or pop the same amount of times, but I don't care. 😏

I may make fun of the interpreter, but it is a pretty nice language.

  • -5 bytes: Use stack instead of tape, and don't restore the tape and stack

Phooey, 53 bytes

[100+1>&<@@%3{"Fizz">&1<}&%5{"Buzz">&1<}&>{<$i>}"
"<]

Try it online!

Outgolfed the creator at his own language. 😏


[100 while cell is not 100
 +1 increment cell
>&< set fizzed flag - empty stack is zero
 @@  push two copies to the stack
 %3 set cell to cell mod 3
 { if cell is not zero
 "Fizz" print fizz
>&1< set fizzed flag
 } endif
 & pop original value from stack
 %5{"Buzz">&1<} repeat for buzz
 & pop again
 >{ if fizzed flag is zero 
 <$i> print number
 } endif 
 "\n" print newline
 <  return to number cell
] end

I may make fun of the interpreter, but it is a pretty nice language.

Phooey, (削除) 53 (削除ここまで)48 bytes

[100+1@@@%3{"Fizz">&1<}&%5{"Buzz">&<}>{&$i}"
"&]

Try it online!

Outgolfed the creator at his own language. 😏


[100 while cell is not 100
 +1 increment cell
 @@@ push three copies to the stack
 %3 set cell to cell mod 3
 { if cell is not zero
 "Fizz" print fizz
>&1< set fizzed flag
 } endif
 & pop original value from stack
 %5{"Buzz">&<} repeat for buzz but pop from stack instead of just 1
 >{ if fizzed flag is zero 
 & Pop
 $i  print number
 } endif 
 "\n" print newline
 & Pop number from stack
] end

The stack and tape are all filled with junk at the end since I don't consistently move the pointer or pop the same amount of times, but I don't care. 😏

I may make fun of the interpreter, but it is a pretty nice language.

  • -5 bytes: Use stack instead of tape, and don't restore the tape and stack
Source Link
EasyasPi
  • 5.4k
  • 20
  • 23

Phooey, 53 bytes

[100+1>&<@@%3{"Fizz">&1<}&%5{"Buzz">&1<}&>{<$i>}"
"<]

Try it online!

Outgolfed the creator at his own language. 😏


[100 while cell is not 100
 +1 increment cell
>&< set fizzed flag - empty stack is zero
 @@ push two copies to the stack
 %3 set cell to cell mod 3
 { if cell is not zero
 "Fizz" print fizz
>&1< set fizzed flag
 } endif
 & pop original value from stack
 %5{"Buzz">&1<} repeat for buzz
 & pop again
>{ if fizzed flag is zero 
 <$i> print number
 } endif 
 "\n" print newline
 < return to number cell
] end

I may make fun of the interpreter, but it is a pretty nice language.

AltStyle によって変換されたページ (->オリジナル) /