Post History
AWK, 62 61 60 56 bytes {for(;i++<$1;)print i%3?i%5?i:y="Buzz":i%5?x="Fizz":x y} {for(;i++<$0;)print i%15?i%5?i%3?i:"Fizz":"Buzz":"FizzBuzz"} {for(;i++<$0;x=""){i%3||x="Fizz";i%5||x=...
Answer
#6: Post edited
# [AWK], ~~62~~ ~~61~~ 60 bytes- {for(;i++<$0;)print i%15?i%5?i%3?i:"Fizz":"Buzz":"FizzBuzz"}
- {for(;i++<$0;x=""){i%3||x="Fizz";i%5||x=x"Buzz";print x?x:i}}
- {for(;i++<$0;){i%3?x="":x="Fizz";i%5?J:x=x"Buzz";print x?x:i}}
- [Try it online!][TIO-lwgttgwi]
- [AWK]: https://www.gnu.org/software/gawk/manual/gawk.html
- [TIO-lwgttgwi]: https://tio.run/##SyzP/v@/Oi2/SMM6U1vbRsXAWrM6U9XYvsJWSckKSLhlVlUpWWeqmtp7AbkVSk6lIH5BUWZeiUKFfYVVZm3t//@GBgYA "AWK – Try It Online"
- This code relies on passing the value 100 (or any number desired) to process. We take advantage of string concatenation and ternary operators.
- A self-contained version:
- BEGIN{for(;i++<100;x=""){i%3||x="Fizz";i%5||x=x"Buzz";print x?x:i}}
- # [AWK], ~~62~~ ~~61~~ ~~60~~ 56 bytes
- {for(;i++<$1;)print i%3?i%5?i:y="Buzz":i%5?x="Fizz":x y}
- {for(;i++<$0;)print i%15?i%5?i%3?i:"Fizz":"Buzz":"FizzBuzz"}
- {for(;i++<$0;x=""){i%3||x="Fizz";i%5||x=x"Buzz";print x?x:i}}
- {for(;i++<$0;){i%3?x="":x="Fizz";i%5?J:x=x"Buzz";print x?x:i}}
- [Try it online!][TIO-lwgttgwi]
- [AWK]: https://www.gnu.org/software/gawk/manual/gawk.html
- [TIO-lwgttgwi]: https://tio.run/##SyzP/v@/Oi2/SMM6U1vbRsXAWrM6U9XYvsJWSckKSLhlVlUpWWeqmtp7AbkVSk6lIH5BUWZeiUKFfYVVZm3t//@GBgYA "AWK – Try It Online"
- This code relies on passing the value 100 (or any number desired) to process. We take advantage of string concatenation and ternary operators.
- A self-contained version:
- BEGIN{for(;i++<100;x=""){i%3||x="Fizz";i%5||x=x"Buzz";print x?x:i}}
#5: Post edited
# [AWK], ~~62~~ 61 bytes- {for(;i++<$0;x=""){i%3||x="Fizz";i%5||x=x"Buzz";print x?x:i}}
- {for(;i++<$0;){i%3?x="":x="Fizz";i%5?J:x=x"Buzz";print x?x:i}}
- [Try it online!][TIO-lwgttgwi]
- [AWK]: https://www.gnu.org/software/gawk/manual/gawk.html
- [TIO-lwgttgwi]: https://tio.run/##SyzP/v@/Oi2/SMM6U1vbRsXAWrM6U9XYvsJWSckKSLhlVlUpWWeqmtp7AbkVSk6lIH5BUWZeiUKFfYVVZm3t//@GBgYA "AWK – Try It Online"
- This code relies on passing the value 100 (or any number desired) to process. We take advantage of string concatenation and ternary operators.
- A self-contained version:
- BEGIN{for(;i++<100;x=""){i%3||x="Fizz";i%5||x=x"Buzz";print x?x:i}}
- # [AWK], ~~62~~ ~~61~~ 60 bytes
- {for(;i++<$0;)print i%15?i%5?i%3?i:"Fizz":"Buzz":"FizzBuzz"}
- {for(;i++<$0;x=""){i%3||x="Fizz";i%5||x=x"Buzz";print x?x:i}}
- {for(;i++<$0;){i%3?x="":x="Fizz";i%5?J:x=x"Buzz";print x?x:i}}
- [Try it online!][TIO-lwgttgwi]
- [AWK]: https://www.gnu.org/software/gawk/manual/gawk.html
- [TIO-lwgttgwi]: https://tio.run/##SyzP/v@/Oi2/SMM6U1vbRsXAWrM6U9XYvsJWSckKSLhlVlUpWWeqmtp7AbkVSk6lIH5BUWZeiUKFfYVVZm3t//@GBgYA "AWK – Try It Online"
- This code relies on passing the value 100 (or any number desired) to process. We take advantage of string concatenation and ternary operators.
- A self-contained version:
- BEGIN{for(;i++<100;x=""){i%3||x="Fizz";i%5||x=x"Buzz";print x?x:i}}
#4: Post edited
# [AWK], 62 bytes- {for(;i++<$0;){i%3?x="":x="Fizz";i%5?J:x=x"Buzz";print x?x:i}}
- [Try it online!][TIO-lwgttgwi]
- [AWK]: https://www.gnu.org/software/gawk/manual/gawk.html
- [TIO-lwgttgwi]: https://tio.run/##SyzP/v@/Oi2/SMM6U1vbRsXAWrM6U9XYvsJWSckKSLhlVlUpWWeqmtp7AbkVSk6lIH5BUWZeiUKFfYVVZm3t//@GBgYA "AWK – Try It Online"
- This code relies on passing the value 100 (or any number desired) to process. We take advantage of string concatenation and ternary operators.
- A self-contained version:
BEGIN{for(;i++<100;){i%3?x="":x="Fizz";i%5?J:x=x"Buzz";print x?x:i}}
- # [AWK], ~~62~~ 61 bytes
- {for(;i++<$0;x=""){i%3||x="Fizz";i%5||x=x"Buzz";print x?x:i}}
- {for(;i++<$0;){i%3?x="":x="Fizz";i%5?J:x=x"Buzz";print x?x:i}}
- [Try it online!][TIO-lwgttgwi]
- [AWK]: https://www.gnu.org/software/gawk/manual/gawk.html
- [TIO-lwgttgwi]: https://tio.run/##SyzP/v@/Oi2/SMM6U1vbRsXAWrM6U9XYvsJWSckKSLhlVlUpWWeqmtp7AbkVSk6lIH5BUWZeiUKFfYVVZm3t//@GBgYA "AWK – Try It Online"
- This code relies on passing the value 100 (or any number desired) to process. We take advantage of string concatenation and ternary operators.
- A self-contained version:
- BEGIN{for(;i++<100;x=""){i%3||x="Fizz";i%5||x=x"Buzz";print x?x:i}}
#3: Post edited
- # [AWK], 62 bytes
- {for(;i++<$0;){i%3?x="":x="Fizz";i%5?J:x=x"Buzz";print x?x:i}}
- [Try it online!][TIO-lwgttgwi]
- [AWK]: https://www.gnu.org/software/gawk/manual/gawk.html
- [TIO-lwgttgwi]: https://tio.run/##SyzP/v@/Oi2/SMM6U1vbRsXAWrM6U9XYvsJWSckKSLhlVlUpWWeqmtp7AbkVSk6lIH5BUWZeiUKFfYVVZm3t//@GBgYA "AWK – Try It Online"
- This code relies on passing the value 100 (or any number desired) to process. We take advantage of string concatenation and ternary operators.
- A self-contained version:
END{for(;i++<100;){i%3?x="":x="Fizz";i%5?J:x=x"Buzz";print x?x:i}}
- # [AWK], 62 bytes
- {for(;i++<$0;){i%3?x="":x="Fizz";i%5?J:x=x"Buzz";print x?x:i}}
- [Try it online!][TIO-lwgttgwi]
- [AWK]: https://www.gnu.org/software/gawk/manual/gawk.html
- [TIO-lwgttgwi]: https://tio.run/##SyzP/v@/Oi2/SMM6U1vbRsXAWrM6U9XYvsJWSckKSLhlVlUpWWeqmtp7AbkVSk6lIH5BUWZeiUKFfYVVZm3t//@GBgYA "AWK – Try It Online"
- This code relies on passing the value 100 (or any number desired) to process. We take advantage of string concatenation and ternary operators.
- A self-contained version:
- BEGIN{for(;i++<100;){i%3?x="":x="Fizz";i%5?J:x=x"Buzz";print x?x:i}}
#2: Post edited
- # [AWK], 62 bytes
- {for(;i++<$0;){i%3?x="":x="Fizz";i%5?J:x=x"Buzz";print x?x:i}}
- [Try it online!][TIO-lwgttgwi]
- [AWK]: https://www.gnu.org/software/gawk/manual/gawk.html
- [TIO-lwgttgwi]: https://tio.run/##SyzP/v@/Oi2/SMM6U1vbRsXAWrM6U9XYvsJWSckKSLhlVlUpWWeqmtp7AbkVSk6lIH5BUWZeiUKFfYVVZm3t//@GBgYA "AWK – Try It Online"
This code relies on passing the value 100 (or any number desired) to process. We take advantage of string concatenation and ternary operators.
- # [AWK], 62 bytes
- {for(;i++<$0;){i%3?x="":x="Fizz";i%5?J:x=x"Buzz";print x?x:i}}
- [Try it online!][TIO-lwgttgwi]
- [AWK]: https://www.gnu.org/software/gawk/manual/gawk.html
- [TIO-lwgttgwi]: https://tio.run/##SyzP/v@/Oi2/SMM6U1vbRsXAWrM6U9XYvsJWSckKSLhlVlUpWWeqmtp7AbkVSk6lIH5BUWZeiUKFfYVVZm3t//@GBgYA "AWK – Try It Online"
- This code relies on passing the value 100 (or any number desired) to process. We take advantage of string concatenation and ternary operators.
- A self-contained version:
- END{for(;i++<100;){i%3?x="":x="Fizz";i%5?J:x=x"Buzz";print x?x:i}}
#1: Initial revision
# [AWK], 62 bytes {for(;i++<$0;){i%3?x="":x="Fizz";i%5?J:x=x"Buzz";print x?x:i}} [Try it online!][TIO-lwgttgwi] [AWK]: https://www.gnu.org/software/gawk/manual/gawk.html [TIO-lwgttgwi]: https://tio.run/##SyzP/v@/Oi2/SMM6U1vbRsXAWrM6U9XYvsJWSckKSLhlVlUpWWeqmtp7AbkVSk6lIH5BUWZeiUKFfYVVZm3t//@GBgYA "AWK – Try It Online" This code relies on passing the value 100 (or any number desired) to process. We take advantage of string concatenation and ternary operators.