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

Timeline for 1, 2, Fizz, 4, Buzz

Current License: CC BY-SA 3.0

10 events
when toggle format what by license comment
Jul 14, 2020 at 12:45 comment added Fabian Röling An interesting trick: The closing bracket in i++<100;) can also be moved to the other closing brackets near the end and it works the same (with the same byte count). But then you have one less smiley in your code. :(
Jun 17, 2020 at 9:04 history edited Community Bot
Commonmark migration
Nov 23, 2017 at 17:48 comment added Olivier Grégoire @HyperNeutrino The enum trick works if you add System.exit(0); at the end. Total length: 112 bytes. enum F{F;{for(int i=0;i++<100;)System.out.println((i%3<1?"Fizz":"")+(i%5<1?"Buzz":i%3<1?"":i));System.exit(0);}}. See my "Hello World" answer for details.
Mar 7, 2016 at 2:56 comment added hyperneutrino That's not quite how enums work. You would have to do enum F{;public..., so you wouldn't actually be saving any bytes.
Nov 28, 2015 at 15:53 comment added TheNumberOne class F{public static -> interface F{static in java 8
Nov 8, 2015 at 18:25 comment added ESP beat me by 14 bytes! Using <1 instead of ==0 is a great way to save!
Sep 24, 2015 at 20:22 comment added user41805 @Geobits I have created a Processing answer based of your Java answer.
Sep 24, 2015 at 19:49 comment added Geobits Hmm. I know the static trick prints to stderr, but I thought enum ran cleanly. Good to know :)
Sep 24, 2015 at 19:47 comment added feersum I don't think the initializer block trick helps here, since the question specifies empty stderr.
Sep 24, 2015 at 19:42 history answered Geobits CC BY-SA 3.0

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