Skip to main content

Java, 100 98 95 94 Bytes (only loop, full code is 136 bytes, see bottom)

for(int i=0;i++<100;){var s=i%3<1?"Fizz":"";s=i%5<1?s+"Buzz":s;System.out.println(s==""?i:s);}

tryTry it here. probablyProbably could be a lot smaller,. I just started to learn java a few days ago (although I do have experience in other languages), this is the best I can do. breakdownBreakdown of how it works, sorry. Sorry if I get some terms wrong or explain stuff badlypoorly:

for(int i=0;i++<100;) 

justJust the loop, - starts at 1 goes to 100:

{var s=i%3<1?"Fizz":"";

Making a variable called "s", equal to a value, if "i" is divisible by 3 with a remainder of less than 1 (1 character/byte smaller than checking ==0), set "s" equal to "buzz". If it isn't, set it equal to "".

s=i%5<1?s+"Buzz":s;

setSet s equal to a value: if i is divisible by 5 with a remainder of less than 1  , set s equal to s + "buzz", if it isn't, set it equal to itself.

System.out.println(s==""?i:s);}

System.out.println is just a simple print statement, inside. Inside it, check if s is equal to "" (if s wasn't divisible by 3 or 5, it would be "") print i (the number), otherwise print s.

feedbackFeedback is greatly appreciated. Edit: 94 bytes for just the loop, below is what I think the full script would be, 136 bytes : (

interface f{static void main(String[]a){for(int i=0;i++<100;){var s=i%3<1?"Fizz":"";s=i%5<1?s+"Buzz":s;System.out.println(s==""?i:s);}}}

Java, 100 98 95 94 Bytes (only loop, full code is 136 bytes, see bottom)

for(int i=0;i++<100;){var s=i%3<1?"Fizz":"";s=i%5<1?s+"Buzz":s;System.out.println(s==""?i:s);}

try it here. probably could be a lot smaller, I just started to learn java a few days ago (although I do have experience in other languages), this is the best I can do. breakdown of how it works, sorry if I get some terms wrong or explain stuff badly

for(int i=0;i++<100;) 

just the loop, starts at 1 goes to 100

{var s=i%3<1?"Fizz":"";

Making a variable called "s", equal to a value, if "i" is divisible by 3 with a remainder of less than 1 (1 character/byte smaller than checking ==0), set "s" equal to "buzz". If it isn't, set it equal to "".

s=i%5<1?s+"Buzz":s;

set s equal to a value: if i is divisible by 5 with a remainder of less than 1  , set s equal to s + "buzz", if it isn't, set it equal to itself

System.out.println(s==""?i:s);}

System.out.println is just a simple print statement, inside it, check if s is equal to "" (if s wasn't divisible by 3 or 5, it would be "") print i (the number), otherwise print s

feedback is greatly appreciated. Edit: 94 bytes for just the loop, below is what I think the full script would be, 136 bytes : (

interface f{static void main(String[]a){for(int i=0;i++<100;){var s=i%3<1?"Fizz":"";s=i%5<1?s+"Buzz":s;System.out.println(s==""?i:s);}}}

Java, 100 98 95 94 Bytes (only loop, full code is 136 bytes, see bottom)

for(int i=0;i++<100;){var s=i%3<1?"Fizz":"";s=i%5<1?s+"Buzz":s;System.out.println(s==""?i:s);}

Try it here. Probably could be a lot smaller. I just started to learn java a few days ago (although I do have experience in other languages), this is the best I can do. Breakdown of how it works. Sorry if I get some terms wrong or explain stuff poorly:

for(int i=0;i++<100;) 

Just the loop - starts at 1 goes to 100:

{var s=i%3<1?"Fizz":"";

Making a variable called "s", equal to a value, if "i" is divisible by 3 with a remainder of less than 1 (1 character/byte smaller than checking ==0), set "s" equal to "buzz". If it isn't, set it equal to "".

s=i%5<1?s+"Buzz":s;

Set s equal to a value: if i is divisible by 5 with a remainder of less than 1, set s equal to s + "buzz", if it isn't, set it equal to itself.

System.out.println(s==""?i:s);}

System.out.println is just a simple print statement. Inside it, check if s is equal to "" (if s wasn't divisible by 3 or 5, it would be "") print i (the number), otherwise print s.

Feedback is greatly appreciated. Edit: 94 bytes for just the loop, below is what I think the full script would be, 136 bytes : (

interface f{static void main(String[]a){for(int i=0;i++<100;){var s=i%3<1?"Fizz":"";s=i%5<1?s+"Buzz":s;System.out.println(s==""?i:s);}}}
added 217 characters in body
Source Link

Java, 100 98 95 94 Bytes (only loop, full code is 136 bytes, see bottom)

for(int i=0;i++<100;){var s=i%3<1?"Fizz":"";s=i%5<1?s+"Buzz":s;System.out.println(s==""?i:s);}

try it here. probably could be a lot smaller, I just started to learn java a few days ago (although I do have experience in other languages), this is the best I can do. breakdown of how it works, sorry if I get some terms wrong or explain stuff badly

for(int i=0;i++<100;) 

just the loop, starts at 1 goes to 100

{var s=i%3<1?"Fizz":"";

Making a variable called "s", equal to a value, if "i" is divisible by 3 with a remainder of less than 1 (1 character/byte smaller than checking ==0), set "s" equal to "buzz". If it isn't, set it equal to "".

s=i%5<1?s+"Buzz":s;

set s equal to a value: if i is divisible by 5 with a remainder of less than 1 , set s equal to s + "buzz", if it isn't, set it equal to itself

System.out.println(s==""?i:s);}

System.out.println is just a simple print statement, inside it, check if s is equal to "" (if s wasn't divisible by 3 or 5, it would be "") print i (the number), otherwise print s

feedback is greatly appreciated. Edit: 94 bytes for just the loop, below is what I think the full script would be, 136 bytes : (

interface f{static void main(String[]a){for(int i=0;i++<100;){var s=i%3<1?"Fizz":"";s=i%5<1?s+"Buzz":s;System.out.println(s==""?i:s);}}}

Java, 100 98 95 94 Bytes (only loop, full code is 136 bytes, see bottom)

for(int i=0;i++<100;){var s=i%3<1?"Fizz":"";s=i%5<1?s+"Buzz":s;System.out.println(s==""?i:s);}

probably could be a lot smaller, I just started to learn java a few days ago (although I do have experience in other languages), this is the best I can do. breakdown of how it works, sorry if I get some terms wrong or explain stuff badly

for(int i=0;i++<100;) 

just the loop, starts at 1 goes to 100

{var s=i%3<1?"Fizz":"";

Making a variable called "s", equal to a value, if "i" is divisible by 3 with a remainder of less than 1 (1 character/byte smaller than checking ==0), set "s" equal to "buzz". If it isn't, set it equal to "".

s=i%5<1?s+"Buzz":s;

set s equal to a value: if i is divisible by 5 with a remainder of less than 1 , set s equal to s + "buzz", if it isn't, set it equal to itself

System.out.println(s==""?i:s);}

System.out.println is just a simple print statement, inside it, check if s is equal to "" (if s wasn't divisible by 3 or 5, it would be "") print i (the number), otherwise print s

feedback is greatly appreciated. Edit: 94 bytes for just the loop, below is what I think the full script would be, 136 bytes : (

interface f{static void main(String[]a){for(int i=0;i++<100;){var s=i%3<1?"Fizz":"";s=i%5<1?s+"Buzz":s;System.out.println(s==""?i:s);}}}

Java, 100 98 95 94 Bytes (only loop, full code is 136 bytes, see bottom)

for(int i=0;i++<100;){var s=i%3<1?"Fizz":"";s=i%5<1?s+"Buzz":s;System.out.println(s==""?i:s);}

try it here. probably could be a lot smaller, I just started to learn java a few days ago (although I do have experience in other languages), this is the best I can do. breakdown of how it works, sorry if I get some terms wrong or explain stuff badly

for(int i=0;i++<100;) 

just the loop, starts at 1 goes to 100

{var s=i%3<1?"Fizz":"";

Making a variable called "s", equal to a value, if "i" is divisible by 3 with a remainder of less than 1 (1 character/byte smaller than checking ==0), set "s" equal to "buzz". If it isn't, set it equal to "".

s=i%5<1?s+"Buzz":s;

set s equal to a value: if i is divisible by 5 with a remainder of less than 1 , set s equal to s + "buzz", if it isn't, set it equal to itself

System.out.println(s==""?i:s);}

System.out.println is just a simple print statement, inside it, check if s is equal to "" (if s wasn't divisible by 3 or 5, it would be "") print i (the number), otherwise print s

feedback is greatly appreciated. Edit: 94 bytes for just the loop, below is what I think the full script would be, 136 bytes : (

interface f{static void main(String[]a){for(int i=0;i++<100;){var s=i%3<1?"Fizz":"";s=i%5<1?s+"Buzz":s;System.out.println(s==""?i:s);}}}
edited body
Source Link

Java, 100 98 95 94 Bytes (only loop, full code is 137136 bytes, see bottom)

for(int i=0;i++<100;){var s=i%3<1?"Fizz":"";s=i%5<1?s+"Buzz":s;System.out.println(s==""?i:s);}

probably could be a lot smaller, I just started to learn java a few days ago (although I do have experience in other languages), this is the best I can do. breakdown of how it works, sorry if I get some terms wrong or explain stuff badly

for(int i=0;i++<101;i=0;i++<100;) 

just the loop, starts at 1 goes to 100

{var s=i%3<1?"Fizz":"";

Making a variable called "s", equal to a value, if "i" is divisible by 3 with a remainder of less than 1 (1 character/byte smaller than checking ==0), set "s" equal to "buzz". If it isn't, set it equal to "".

s=i%5<1?s+"Buzz":s;

set s equal to a value: if i is divisible by 5 with a remainder of less than 1 , set s equal to s + "buzz", if it isn't, set it equal to itself

System.out.println(s==""?i:s);}

System.out.println is just a simple print statement, inside it, check if s is equal to "" (if s wasn't divisible by 3 or 5, it would be "") print i (the number), otherwise print s

feedback is greatly appreciated. Edit: 9594 bytes for just the loop, below is what I think the full script would be, 139136 bytes : (

interface f{static void main(String[]a){for(int i=0;i++<100;){var s=i%3<1?"Fizz":"";s=i%5<1?s+"Buzz":s;System.out.println(s==""?i:s);}}}

Java, 100 98 95 94 Bytes (only loop, full code is 137 bytes, see bottom)

for(int i=0;i++<100;){var s=i%3<1?"Fizz":"";s=i%5<1?s+"Buzz":s;System.out.println(s==""?i:s);}

probably could be a lot smaller, I just started to learn java a few days ago (although I do have experience in other languages), this is the best I can do. breakdown of how it works, sorry if I get some terms wrong or explain stuff badly

for(int i=0;i++<101;) 

just the loop, starts at 1 goes to 100

{var s=i%3<1?"Fizz":"";

Making a variable called "s", equal to a value, if "i" is divisible by 3 with a remainder of less than 1 (1 character/byte smaller than checking ==0), set "s" equal to "buzz". If it isn't, set it equal to "".

s=i%5<1?s+"Buzz":s;

set s equal to a value: if i is divisible by 5 with a remainder of less than 1 , set s equal to s + "buzz", if it isn't, set it equal to itself

System.out.println(s==""?i:s);}

System.out.println is just a simple print statement, inside it, check if s is equal to "" (if s wasn't divisible by 3 or 5, it would be "") print i (the number), otherwise print s

feedback is greatly appreciated. Edit: 95 bytes for just the loop, below is what I think the full script would be, 139 bytes : (

interface f{static void main(String[]a){for(int i=0;i++<100;){var s=i%3<1?"Fizz":"";s=i%5<1?s+"Buzz":s;System.out.println(s==""?i:s);}}}

Java, 100 98 95 94 Bytes (only loop, full code is 136 bytes, see bottom)

for(int i=0;i++<100;){var s=i%3<1?"Fizz":"";s=i%5<1?s+"Buzz":s;System.out.println(s==""?i:s);}

probably could be a lot smaller, I just started to learn java a few days ago (although I do have experience in other languages), this is the best I can do. breakdown of how it works, sorry if I get some terms wrong or explain stuff badly

for(int i=0;i++<100;) 

just the loop, starts at 1 goes to 100

{var s=i%3<1?"Fizz":"";

Making a variable called "s", equal to a value, if "i" is divisible by 3 with a remainder of less than 1 (1 character/byte smaller than checking ==0), set "s" equal to "buzz". If it isn't, set it equal to "".

s=i%5<1?s+"Buzz":s;

set s equal to a value: if i is divisible by 5 with a remainder of less than 1 , set s equal to s + "buzz", if it isn't, set it equal to itself

System.out.println(s==""?i:s);}

System.out.println is just a simple print statement, inside it, check if s is equal to "" (if s wasn't divisible by 3 or 5, it would be "") print i (the number), otherwise print s

feedback is greatly appreciated. Edit: 94 bytes for just the loop, below is what I think the full script would be, 136 bytes : (

interface f{static void main(String[]a){for(int i=0;i++<100;){var s=i%3<1?"Fizz":"";s=i%5<1?s+"Buzz":s;System.out.println(s==""?i:s);}}}
added 6 characters in body
Source Link
Loading
deleted 10 characters in body
Source Link
Loading
changed the 100 in (int i=1;i<100;i++) to 101 because my code was printing up to 99 and not printing 100, oops. Also capitalized Fizz and Buzz
Source Link
Loading
added 69 characters in body
Source Link
Loading
deleted 2 characters in body
Source Link
Loading
updated title to better explain what the byte count is, as to not mislead people
Source Link
Loading
Source Link
Loading