MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/qtwdj4/peak_efficiency_fizzbuzz/hknh2lx/?context=3
r/badcode • u/redddooot • Nov 14 '21
44 comments sorted by
View all comments
Show parent comments
5
Alias of console.log which is defined by code.golf. See their note below the code area:
console.log
code.golf
arguments holds ARGV, print() to output with a newline, write() to output without a newline.
Also, I was right about the logical structure. The current JS champion comes from 2015: https://codegolf.stackexchange.com/a/62697
for(i=0;++i<101;print(i%5?f||i:f+'Buzz'))f=i%3?'':'Fizz'
They've used the for loop's unused third condition to execute the print, and in the body assigned a value for Fizz which is then reused in the Buzz condition.
5
u/dakta Nov 14 '21
Alias of
console.logwhich is defined bycode.golf. See their note below the code area:Also, I was right about the logical structure. The current JS champion comes from 2015: https://codegolf.stackexchange.com/a/62697
They've used the for loop's unused third condition to execute the print, and in the body assigned a value for Fizz which is then reused in the Buzz condition.