# 1, 2, Fizz, 4, Buzz

## Introduction

In our recent effort to collect catalogues of shortest solutions for standard programming exercises, here is PPCG's first ever vanilla FizzBuzz challenge. If you wish to see other catalogue challenges, there is "Hello World!" and "Is this number a prime?".

## Challenge

Write a program that prints the decimal numbers from 1 to 100 inclusive. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

## Output

The output will be a list of numbers (and Fizzes, Buzzes and FizzBuzzes) separated by a newline (either \n or \r\n). A trailing newline is acceptable, but a leading newline is not. Apart from your choice of newline, the output should look exactly like this:

1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz
Fizz
22
23
Fizz
Buzz
26
Fizz
28
29
FizzBuzz
31
32
Fizz
34
Buzz
Fizz
37
38
Fizz
Buzz
41
Fizz
43
44
FizzBuzz
46
47
Fizz
49
Buzz
Fizz
52
53
Fizz
Buzz
56
Fizz
58
59
FizzBuzz
61
62
Fizz
64
Buzz
Fizz
67
68
Fizz
Buzz
71
Fizz
73
74
FizzBuzz
76
77
Fizz
79
Buzz
Fizz
82
83
Fizz
Buzz
86
Fizz
88
89
FizzBuzz
91
92
Fizz
94
Buzz
Fizz
97
98
Fizz
Buzz


The only exception to this rule is constant output of your language's interpreter that cannot be suppressed, such as a greeting, ANSI color codes or indentation.

## Further Rules

• This is not about finding the language with the shortest approach for playing FizzBuzz, this is about finding the shortest approach in every language. Therefore, no answer will be marked as accepted.

• Submissions are scored in bytes in an appropriate preexisting encoding, usually (but not necessarily) UTF-8. Some languages, like Folders, are a bit tricky to score--if in doubt, please ask on Meta.

• Nothing can be printed to STDERR.

• Feel free to use a language (or language version) even if it's newer than this challenge. If anyone wants to abuse this by creating a language where the empty program generates FizzBuzz output, then congrats for paving the way for a very boring answer.

Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language.

• If your language of choice is a trivial variant of another (potentially more popular) language which already has an answer (think BASIC or SQL dialects, Unix shells or trivial Brainfuck derivatives like Alphuck and ???), consider adding a note to the existing answer that the same or a very similar solution is also the shortest in the other language.

• Because the output is fixed, you may hardcode the output (but this may not be the shortest option).

• You may use preexisting solutions, as long as you credit the original author of the program.

• Standard loopholes are otherwise disallowed.

As a side note, please don't downvote boring (but valid) answers in languages where there is not much to golf; these are still useful to this question as it tries to compile a catalogue as complete as possible. However, do primarily upvote answers in languages where the authors actually had to put effort into golfing the code.

## Catalogue

var QUESTION_ID=58615;var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";var COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk";var OVERRIDE_USER=30525;var answers=[],answers_hash,answer_ids,answer_page=1,more_answers=true,comment_page;function answersUrl(index){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+index+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(index,answers){return"https://api.stackexchange.com/2.2/answers/"+answers.join(';')+"/comments?page="+index+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:true,success:function(data){answers.push.apply(answers,data.items);answers_hash=[];answer_ids=[];data.items.forEach(function(a){a.comments=[];var id=+a.share_link.match(/\d+/);answer_ids.push(id);answers_hash[id]=a});if(!data.has_more)more_answers=false;comment_page=1;getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:true,success:function(data){data.items.forEach(function(c){if(c.owner.user_id===OVERRIDE_USER)answers_hash[c.post_id].comments.push(c)});if(data.has_more)getComments();else if(more_answers)getAnswers();else process()}})}getAnswers();var SCORE_REG=/<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;var OVERRIDE_REG=/^Override\s*header:\s*/i;function getAuthorName(a){return a.owner.display_name}function process(){var valid=[];answers.forEach(function(a){var body=a.body;a.comments.forEach(function(c){if(OVERRIDE_REG.test(c.body))body='<h1>'+c.body.replace(OVERRIDE_REG,'')+'</h1>'});var match=body.match(SCORE_REG);if(match)valid.push({user:getAuthorName(a),size:+match[2],language:match[1],link:a.share_link,});else console.log(body)});valid.sort(function(a,b){var aB=a.size,bB=b.size;return aB-bB});var languages={};var place=1;var lastSize=null;var lastPlace=1;valid.forEach(function(a){if(a.size!=lastSize)lastPlace=place;lastSize=a.size;++place;var answer=jQuery("#answer-template").html();answer=answer.replace("{{PLACE}}",lastPlace+".").replace("{{NAME}}",a.user).replace("{{LANGUAGE}}",a.language).replace("{{SIZE}}",a.size).replace("{{LINK}}",a.link);answer=jQuery(answer);jQuery("#answers").append(answer);var lang=a.language;lang=jQuery('<a>'+lang+'</a>').text();languages[lang]=languages[lang]||{lang:a.language,lang_raw:lang.toLowerCase(),user:a.user,size:a.size,link:a.link}});var langs=[];for(var lang in languages)if(languages.hasOwnProperty(lang))langs.push(languages[lang]);langs.sort(function(a,b){if(a.lang_raw>b.lang_raw)return 1;if(a.lang_raw<b.lang_raw)return-1;return 0});for(var i=0;i<langs.length;++i){var language=jQuery("#language-template").html();var lang=langs[i];language=language.replace("{{LANGUAGE}}",lang.lang).replace("{{NAME}}",lang.user).replace("{{SIZE}}",lang.size).replace("{{LINK}}",lang.link);language=jQuery(language);jQuery("#languages").append(language)}}
body{text-align:left!important}#answer-list{padding:10px;width:290px;float:left}#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="language-list"> <h2>Shortest Solution by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr> </thead> <tbody id="languages"> </tbody> </table> </div> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr> </thead> <tbody id="answers"> </tbody> </table> </div> <table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr> </tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr> </tbody> </table>

• Nothing can be printed to STDERR. Is this true only when running, or also when compiling (assuming that is a separate step?) – AShelly Sep 24 '15 at 20:47
• @AShelly Only when running – Beta Decay Sep 24 '15 at 20:48
• I’m not sure I like the fact that you hardcoded the 100 into the challenge. That way, a program that just generates the expected output is a valid entry, but is not interesting for this challenge. I think the challenge should expect the program to input the number of items to output. – Timwi Sep 24 '15 at 23:28
• @Timwi While I agree that it would make it (only slightly) more interesting, I've very often seen FizzBuzz as strictly 1 to 100 (on Wikipedia and Rosetta Code, for example). If the goal is to have a "canonical" FB challenge, it makes sense. – Geobits Sep 25 '15 at 0:50
• A "vanilla fizzbuzz" sounds delicious. – Reinstate Monica -- notmaynard Sep 25 '15 at 15:12

# Julia 1.0, 72 bytes

(n->println([n,"Fizz","Buzz","FizzBuzz"][sum(n.%[1,3,5,5].<1)])).(1:100)


Not the shortest solution possible, but I like the obfuscation. Try it online!

### Explanation

We apply an anonymous function (n->...) itemwise .( ) to the range 1:100.

The function body does this (using sample input n=5):

n.%[1,3,5,5]          # Modulo n by each of these numbers                     [0,2,0,0]
.<1                   # Itemwise, is each remainder zero?                     [true,false,true,true]
sum(  )               # Count number of trues in the array                    3
# This will be 4 for multiples of 15, 3 for multiples
# of 5, 2 for multiples of 3, and 1 for other numbers
[n,"F","B","FB"][  ]  # Index (1-based) into this array                       "Buzz"
println(  )           # Print, with a newline


# Javascript, 80 bytes

for(i=1;i<101;i++){console.log(i%3==0?i%5==0?"FizzBuzz":"Fizz":i%5==0?"Buzz":i)}

• To whoever downvoted this; you really should explain why. Especially considering Jey is a new contributor. – Marie Feb 27 '19 at 19:27

# APL (Dyalog Unicode), 37 bytesSBCS

↑{∨/d←4/0=3 5|⍵:d/'FizzBuzz'⋄⍕⍵}¨⍳100


Try it online!

⍳100ɩndices 1…100

{}¨ apply the following anonymous lambda to each of those:

⍵ the argument; e.g. 20

3 5| the division remainder when that is divided by 3 and 5; e.g. [2,0]

0= Boolean mask where that is equal to 0; e.g. [0,1]

4/ replicate those numbers for 4 copies of each; e.g. [0,0,0,0,1,1,1,1]

d← assign that to d

∨/: if any of those are true (OR-reduction); e.g. true:

d/'FizzBuzz' use d to mask the characters of the string; e.g. "Buzz"

⋄ else:

⍕⍵ stringify the argument; e.g. "20"

↑ mix the list of strings into a matrix, so it prints right

• Art⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ – Andrew Ogden Mar 30 at 15:42
• @AndrewOgden Thank you! – Adám Mar 30 at 15:58

# SNOBOL4 (CSNOBOL4), 137121 114 bytes

I	X =X + 1
O =EQ(REMDR(X,3)) 'Fizz'
O =O EQ(REMDR(X,5)) 'Buzz'
O =IDENT(O) X
OUTPUT =O
O =LT(X,100) :S(I)
END


Try it online!

## Explanation:

					;* uninitialized variables start as ''
;* which is coerced to 0 in computations
I	X =X + 1			;* Increment X
O =EQ(REMDR(X,3)) 'Fizz'	;* if X mod 3 == 0, O = 'Fizz'
O =O EQ(REMDR(X,5)) 'Buzz'	;* if X mod 5 == 0, concatenate O and 'Buzz'
O =IDENT(O) X			;* if O is IDENTical to the empty string,
;* set O to X
OUTPUT =O			;* print O
O =LT(X,100) :S(I)		;* set O to '' and if X < 100, goto I
END


# Zsh, 105786866 61 bytes

Try it online!

for i ({1..100})(((i%3))||w=Fizz;((i%5))||w+=Buzz;<<<${w-$i})


-27 using simpler approach
-10 using parameter fallback
-2 thanks to @Dennis - kudos for the bash solution
-5 thanks to @GammaFunction

Original solution, using weird r flag... try it online

for ((;i++<100;));{f=$[i%3>0?0:4] b=$[i%5>0?0:4]
o"Buzz"/$0oo Also push a 0 to the stack .......... Multiply the top two values of the stack. ..oan?*... If the counter was divisible by 5 or 3 print the number .......... Print a newline and loop around again  As time goes, the stack fills up, with an extra copy of the counter for each Fizz or Buzz (and two for FizzBuzzes). This is due to the extra copy(s) of the counter that don't end up being printed. # Spaghetti, 522 bytes main:0"n"goto store goto l l:100"n"goto retrieve goto areEqual"EOF"goto jumpIfTrue"n"goto retrieve 1 2 goto add"n"goto store 15"n"goto retrieve 2 goto modulus 0 goto areEqual"f"goto jumpIfTrue 3"n"goto retrieve 2 goto modulus 0 goto areNotEqual"b"goto jumpIfTrue"Fizz"1 goto print goto b t:3"n"goto retrieve 2 goto modulus 0 goto areEqual"l"goto jumpIfTrue"n"goto retrieve 1 goto print goto l b:5"n"goto retrieve 2 goto modulus 0 goto areNotEqual"t"goto jumpIfTrue"Buzz"1 goto print goto l f:"FizzBuzz"1 goto print goto l  Requires a newline at the end, cause otherwise the interpreter throws a hissy fit. Spaghetti is a stack based language that promotes using goto extensively. That means, every single operation you use requires a goto statement along with it. That being said, this took a while. Commented version is at the Spaghetti examples. Try it on the online interpreter! (Code must be pasted in) # Python 3, 888577 73 bytes i=0 exec("i+=1;print(i%3*i%5and i or(i%3<1)*'Fizz'+(i%5<1)*'Buzz');"*100)  Try it online! # jq, 45 bytes range(100)+1|(1-.%3)*"fizz"+(1-.%5)*"buzz"//. # explanation range(100)+1| # for each number in range 0-99 + 1 . % 3 ) # the current number modulo 3 ( 1 - # the important thing is this gives 1 for 0 and an invalid # number (0 or negative) for any positive number *"fizz"# "fizz" repeated that many times. For a negative or 0 number # this returns null + ..."buzz" # concatenated with the same thing but for buzz. # null + anything is that thing, so for a number not divisible by # 3 or 5 this returns null // . # if the result is null, the number itself # implicit output  For best results run with jq -rn '...' | less. # Turing Machine Code, 5743 bytes Should note that Turing Machine Code doesn't process newlines/carriage returns. So everything is necessarily on one line. Thus this may not be, by strict interpretation of the rules, a competing answer due to the nature of the language. 0 * * * 1 1 * 1 r # # * # * f f * * l f f 1 1 l ! f 2 2 l " f 3 3 l £ f 4 4 l$
f 5 5 l %
f 6 6 l ^
f 7 7 l &
f 8 8 l 
f 9 9 l (
f 0 0 l )
f F F l f
f i i l f
f z z l f
f B B l f
f u u l f
) 1 1 * ¬
) 2 2 * -
) 3 3 * =
) 4 4 * +
) 5 5 * {
) 6 6 * }
) 7 7 * [
) 8 8 * ]
) 9 9 * :
! _ _ r '
! 1 1 r @
! 2 2 * ~
! 3 3 r \
! 4 4 r /
! 5 5 * ,
! 6 6 r .
! 7 7 r <
! 8 8 * >
! 9 9 r ?
" _ _ r a
" 1 1 * b
" 2 2 r c
" 3 3 r d
" 4 4 * e
" 5 5 r ƒ
" 6 6 r g
" 7 7 * h
" 8 8 r ï
" 9 9 r j
£ _ _ r k
£ 1 1 r l
£ 2 2 r m
£ 3 3 * n
£ 4 4 r o
£ 5 5 r p
£ 6 6 * q
£ 7 7 r r
£ 8 8 r s
£ 9 9 * t
$_ _ r ü$ 1 1 r v
$2 2 * w$ 3 3 r x
$4 4 r y$ 5 5 * ž
$6 6 r A$ 7 7 r Ɓ
$8 8 * C$ 9 9 r D
% _ _ r E
% 1 1 * Ϝ
% 2 2 * G
% 3 3 * H
% 4 4 * I
% 5 5 * J
% 6 6 * K
% 7 7 * L
% 8 8 * M
% 9 9 * N
^ _ _ r O
^ 1 1 r P
^ 2 2 r Q
^ 3 3 * R
^ 4 4 r S
^ 5 5 r T
^ 6 6 * U
^ 7 7 r V
^ 8 8 r W
^ 9 9 * X
& _ _ r Y
& 1 1 r Z
& 2 2 * α
& 3 3 r β
& 4 4 r γ
& 5 5 * δ
& 6 6 r ε
& 7 7 r ζ
& 8 8 * η
& 9 9 r θ
_ _ r ι
 1 1 * κ
2 2 r λ
 3 3 r μ
4 4 * ν
 5 5 r ξ
6 6 r ο
 7 7 * π
8 8 r ρ
 9 9 r ς
( _ _ r σ
( 1 1 r τ
( 2 2 r υ
( 3 3 * φ
( 4 4 r χ
( 5 5 r ψ
( 6 6 * ω
( 7 7 r Α
( 8 8 r Β
( 9 9 * Γ
@ * * r @
@ # _ r Δ
Δ _ 1 r Ε
Ε _ 2 r F
' * * r '
' # _ r 2
2 _ 2 r #
~ * * r ~
~ 2 _ r ~
~ 1 _ r ~
~ # _ r Ζ
Ζ _ 2 r 2
\ * * r \
\ # _ r Η
Η _ 3 r 2
/ * * r /
/ # _ r Θ
Θ _ 4 r Ε
, * * r ,
, 5 _ r ,
, 1 _ r ,
, # _ r Ι
Ι _ 5 r 2
. * * r .
. # _ r Κ
Κ _ 6 r 2
< * * r <
< # _ r Λ
Λ _ 7 r Ε
> * * r >
> 8 _ r >
> 1 _ r >
> # _ r Μ
Μ _ 8 r 2
? * * r ?
? # _ r Ν
Ν _ 9 r 2
a * * r a
a # _ r Ξ
Ξ _ 3 r F
3 _ 3 r #
b * * r b
b 1 _ r b
b 2 _ r b
b # _ r Ο
Ο _ 1 r 3
c * * r c
c # _ r Π
Π _ 2 r 3
d * * r d
d # _ r Ρ
Ρ _ 3 r Ξ
e * * r e
e 4 _ r e
e 2 _ r e
e # _ r Σ
Σ _ 4 r 3
ƒ * * r ƒ
ƒ # _ r Τ
Τ _ 5 r 3
g * * r g
g # _ r Υ
Υ _ 6 r Ξ
h * * r h
h 7 _ r h
h 2 _ r h
h # _ r Φ
Φ _ 7 r 3
ï * * r ï
ï # _ r Χ
Χ _ 8 r 3
j * * r j
j # _ r Ψ
Ψ _ 9 r Ξ
k * * r k
k 3 _ r k
k # _ r 4
4 _ 4 r #
Ω _ 4 r F
l * * r l
l # _ r ¤
¤ _ 1 r 4
m * * r m
m # _ r ¥
¥ _ 2 r Ω
n * * r n
n 3 _ r n
n # _ r ¦
¦ _ 3 r 4
o * * r o
o # _ r ¨
¨ _ 4 r 4
p * * r p
q * * r q
q 6 _ r q
q 3 _ r q
q # _ r ª
ª _ 6 r 4
r * * r r
r # _ r «
« _ 7 r 4
s * * r s
s # _ r ®
® _ 8 r Ω
t * * r t
t 9 _ r t
t 3 _ r t
t # _ r °
° _ 9 r 4
ü * * r ü
ü # _ r ±
± _ 5 r B
v * * r v
v # _ r ²
² _ 1 r ³
³ _ 5 r Ƒ
5 _ 5 r #
w * * r w
w 2 _ r w
w 4 _ r w
w # _ r ¶
¶ _ 2 r ±
x * * r x
x # _ r ·
· _ 3 r ±
y * * r y
y # _ r ¸
¸ _ 4 r ³
ž * * r ž
ž 5 _ r ž
ž 4 _ r ž
ž # _ r ¹
¹ _ 5 r ±
A * * r A
A # _ r »
» _ 6 r ±
Ɓ * * r Ɓ
Ɓ # _ r ¼
¼ _ 7 r ³
C * * r C
C 8 _ r C
C 4 _ r C
C # _ r ½
½ _ 8 r ±
D * * r D
D # _ r ¾
¾ _ 9 r ±
E * * r E
E # _ r ¿
E 5 _ r E
¿ _ 6 r F
6 _ 6 r #
Ϝ * * r Ϝ
Ϝ 1 _ r Ϝ
Ϝ 5 _ r Ϝ
Ϝ # _ r À
À _ 1 r 6
G * * r G
G 2 _ r G
G 5 _ r G
G # _ r Á
Á _ 2 r 6
H * * r H
H 3 _ r H
H 5 _ r H
H # _ r Â
Â _ 3 r ¿
I * * r I
I 4 _ r I
I 5 _ r I
I # _ r Ã
Ã _ 4 r 6
J * * r J
J 5 _ r J
J # _ r Ä
Ä _ 5 r 6
K * * r K
K 6 _ r K
K 5 _ r K
K # _ r Å
Å _ 6 r ¿
L * * r L
L 7 _ r L
L 5 _ r L
L # _ r Æ
Æ _ 7 r 6
M * * r M
M 8 _ r M
M 5 _ r M
M # _ r Ç
Ç _ 8 r 6
N * * r N
N 9 _ r N
N 5 _ r N
N # _ r È
È _ 9 r ¿
O * * r O
O 6 _ r O
O # _ r 7
7 _ 7 r #
É _ 7 r F
P * * r P
P # _ r Ê
Ê _ 1 r 7
Q * * r Q
Q # _ r Ë
Ë _ 2 r É
R * * r R
R 3 _ r R
R 6 _ r R
R # _ r Ì
Ì _ 3 r 7
S * * r S
S # _ r Í
Í _ 4 r 7
T * * r T
T # _ r Ï
Ï _ 5 r É
U * * r U
U 6 _ r U
U # _ r Ð
Ð _ 6 r 7
V * * r V
V # _ r Ñ
Ñ _ 7 r 7
W * * r W
W # _ r Ò
Ò _ 8 r É
X * * r X
X 9 _ r X
X 6 _ r X
X # _ r Ó
Ó _ 9 r 7
Y * * r Y
Y # _ r 8
8 _ 8 r #
Z * * r Z
Z # _ r Ô
Ô _ 1 r Õ
Õ _ 8 r F
α * * r α
α 2 _ r α
α 7 _ r α
α # _ r Ö
Ö _ 2 r 8
β * * r β
β # _ r ×
× _ 3 r 8
γ * * r γ
γ # _ r Ø
Ø _ 4 r Õ
δ * * r δ
δ 5 _ r δ
δ 7 _ r δ
δ # _ r Ù
Ù _ 5 r 8
ε * * r ε
ε # _ r Ú
Ú _ 6 r 8
ζ * * r ζ
ζ # _ r Û
Û _ 7 r Õ
η * * r η
η 8 _ r η
η 7 _ r η
η # _ r Ü
Ü _ 8 r 8
θ * * r θ
θ # _ r Ý
Ý _ 9 r 8
ι * * r ι
ι # _ r Ā
Ā _ 9 r F
9 _ 9 r #
κ * * r κ
κ 1 _ r κ
κ 8 _ r κ
κ # _ r Ă
Ă _ 1 r 9
λ * * r λ
λ # _ r Ą
Ą _ 2 r 9
μ * * r μ
μ # _ r Ć
Ć _ 3 r Ā
ν * * r ν
ν 4 _ r ν
ν 8 _ r ν
ν # _ r Ĉ
Ĉ _ 4 r 9
ξ * * r ξ
ξ # _ r Ċ
Ċ _ 5 r 9
ο * * r ο
ο # _ r Đ
Đ _ 6 r Ā
π * * r π
π 7 _ r π
π 8 _ r π
π # _ r Ē
Ē _ 7 r 9
ρ * * r ρ
ρ # _ r Ĕ
Ĕ _ 8 r 9
ς * * r ς
ς # _ r Ė
Ė _ 9 r Ā
Č _ 0 r #
σ * * r σ
σ # _ r Ę
σ 9 _ r σ
Ę _ 1 r Ď
Ď _ 0 r B
τ * * r τ
τ # _ r Ě
Ě _ 2 r Ď
υ * * r υ
υ # _ r Ĝ
Ĝ _ 3 r Ğ
Ğ _ 0 r Ƒ
φ * * r φ
φ 3 _ r φ
φ 9 _ r φ
φ # _ r Ġ
Ġ _ 4 r Ď
χ * * r χ
χ # _ r Ģ
Ģ _ 5 r Ď
ψ * * r ψ
ψ # _ r Ĥ
Ĥ _ 6 r Ğ
ω * * r ω
ω # _ r Ħ
ω 6 _ r ω
ω 9 _ r ω
Ħ _ 7 r Ď
Α * * r Α
Α # _ r Ĩ
Ĩ _ 8 r Ď
Β * * r Β
Β # _ r Ī
Ī _ 9 r Ğ
Γ * * r Γ
Γ 9 _ r Γ
Γ # _ r Ĭ
Ĭ _ B r Į
Į _ u r İ
İ _ z r Ĳ
Ĳ _ z r halt
Ĵ _ 1 r #
Ķ _ 1 r F
¬ * * r ¬
¬ 1 _ r ¬
¬ 0 _ r ¬
¬ # _ r Ĺ
Ĺ _ 1 r Ĵ
- * * r -
- 2 _ r -
- 0 _ r -
- # _ r Ļ
Ļ _ 2 r Ķ
= * * r =
= 3 _ r =
= 0 _ r =
= # _ r Ľ
Ľ _ 3 r Ĵ
+ * * r +
+ 4 _ r +
+ 0 _ r +
+ # _ r Ŀ
Ŀ _ 4 r Ĵ
{ * * r {
{ 5 _ r {
{ 0 _ r {
{ # _ r Ł
Ł _ 5 r Ķ
} * * r }
} 6 _ r }
} 0 _ r }
} # _ r Ń
Ń _ 6 r Ĵ
[ * * r [
[ 7 _ r [
[ 0 _ r [
[ # _ r Ň
Ň _ 7 r Ĵ
] * * r ]
] 8 _ r ]
] 0 _ r ]
] # _ r Ņ
Ņ _ 8 r Ķ
: * * r :
: 9 _ r :
: 0 _ r :
: # _ r Ŋ
Ŋ _ 9 r Ĵ
F _ F r i
i _ i r ȥ
ȥ _ z r ź
ź _ z r #
Ƒ _ F r í
í _ i r ż
ż _ z r ƶ
ƶ _ z r B
B _ B r u
u _ u r z
z _ z r ź


Try it online!

# JavaScript, 73 bytes

for(i=s='';i++<100;s+=((i%3?'':'Fizz')+(i%5?'':'Buzz')||i)+"\n");alert(s)


# PHP, 73 71 bytes

<?for($i=0;$i++<100;)echo$i%3?$i%5?$i:@Buzz:@Fizz.($i%5?"":@Buzz),"
";


All the most terrible things. I wanted the wrongheaded ternary to do something magical, but it did not.

# Ceylon, 368144123 96 bytes

shared void z(){for(i in 1..100){print(["FizzBuzz","Buzz","Fizz",i][(i%5).sign*2+(i%3).sign]);}}


Here we have the ungolfed original of 368 bytes:

shared void fizzBuzz() {
for(i in 1..100) {
if(3.divides(i)){
if(5.divides(i)) {
print("FizzBuzz");
} else {
print("Fizz");
}
} else {
if(5.divides(i)) {
print("Buzz");
} else {
print(i);
}
}
}
}


In Ceylon, Integers are also just objects, so one can call methods on them (like the divides method here).

1..100 is syntactic sugar for span(1, 100), which is a Range<Integer>, which implements Iterable<Integer>, and can therefore be used with the for loop.

The print function takes one argument (of type Anything), stringifies it (i.e. if it's an object, calls its .string attribute, if it's null, takes "<null>") and prints it to the standard output.

Removing whitespace, using a shorter function name, and replacing x.divides(y) by the shorter y%x==0, which is essentially how divides is implemented, gives us this (144 bytes):

shared void f(){for(i in 1..100){if(i%3==0){if(i%5==0){print("FizzBuzz");}else{print("Fizz");}}else{if(i%5==0){print("Buzz");}else{print(i);}}}}


Of course, this is not the best which is possible ... this uses print and if much too often, and also does the check for divisibility by 5 twice.

Integers (or Numbers types in general) have also the .sign attribute, which is 1 for positive numbers, 0 for zero, and -1 for negatives. We can use that together with the remainder operator to get a different value for each of the four cases: (i % 5).sign * 2 + (i % 3).sign]. This is 0 for FizzBuzz, 1 for Buzz, 2 for Fizz and 3 for the "plain" case. We can use this as an index of a tuple, coming to this 123-bytes program:

shared void z() {
for(i in 1..100) {
print(["FizzBuzz", "Buzz", "Fizz", i][(i%5).sign*2 + (i%3).sign]);
}
}


([...] is the syntax for both Tuple creation (here a Tuple with element types String, String, String, Integer, formally Tuple<String|Integer, String, Tuple<String|Integer, String, Tuple<String|Integer, String, Tuple<Integer, Integer, Empty>>>, which can be written shorter as [String, String, String, Integer]) and lookup in a Correspondence (and this tuple type implements Correspondence<Integer, String|Integer>).

Removing the whitespace again gives us this 96 byte program:

shared void z(){for(i in 1..100){print(["FizzBuzz","Buzz","Fizz",i][(i%5).sign*2+(i%3).sign]);}}


# VB.Net, 147 146 bytes

Module F
Sub Main()
For i=1To 100
Dim a=i Mod 3,b=i Mod 5
Console.WriteLine("{0:#}{1:;;Fizz}{2:;;Buzz}",If(a*b>0,i,0),a,b)
Next
End Sub
End Module


It uses the same conditional formatting trick as the C# answer by Pierre-Luc Pineault.

UPDATED: saved 1 byte thanks to Brian J

• you can save a byte by using If instead of IIf. The difference is that IIf is a function that will evaluate both the true and false options, while If is an operator that will only evaluate the option it needs. Functionally doesn't make a difference in this case, but does save a character. – Brian J Sep 25 '15 at 13:13

# Python 2, 148 133 Bytes

def f(n):
if n%3+n%5<1:return"FizzBuzz"
if n%5<1:return"Buzz"
if n%3<1:return"Fizz"
return n
for x in map(f,range(1,101)):print x

• it is possible to save some bytes by reducing the amount of indentation. (1 space is sufficient) – Mohammad Sep 27 '15 at 18:12
• @Mhmd it's probably actually tabs, SE converts them to 4 spaces. – undergroundmonorail Sep 27 '15 at 22:18
• if n%3+n%5==0:return"FizzBuzz" -> if n%3+n%5==0:return f(3)+f(5) EDIT: nevermind i miscounted, it's the same – undergroundmonorail Sep 27 '15 at 22:19
• oh, but you can change ==0 to <1 everywhere it appears – undergroundmonorail Sep 27 '15 at 22:58
• This can be shortened significantly by removing the function and return logic: for i in range(100):print(i%3+i%5<1and'FizzBuzz')or(i%5<1and'Buzz')or(i%3<1and'Fizz')or i golfs it down to 89 bytes. – Skyler Oct 26 '15 at 13:47

## C# using LINQ, 168 186

using System.Linq;class A{static void Main(){foreach(var s in Enumerable.Range(1,100).Select(n=>n%3==0?n%5==0?"FizzBuzz":"Fizz":n%5==0?"Buzz":n.ToString()))System.Console.WriteLine(s);}}


# haxe, 110 bytes

class Main{
static function main()
for(i in 1...101)
Sys.println(i%3<1?"Fizz"+(i%5<1?"Buzz":""):i%5<1?"Buzz":i);
}


(newlines and indents added for clarity)

Haxe isn't much of a golfing language … I was trying to do something with enumerators:

class Main{
static function main()
for(i in 1...101)
Sys.println(
switch(i){
case _%3=>0:i%5<1?"FizzBuzz":"Fizz";
case _%5=>0:"Buzz";
case _:i;
}
);
}


But 140 bytes. :I

## C#, 155 142 Bytes

class a{static void Main(){for(int i=0;i++<100;){var s="";if(i%3<1)s="Fizz";if(i%5<1)s+="Buzz";if(s=="")s=i+"";System.Console.WriteLine(s);}}}


Added as an alternate approach to the example using LINQ

Thanks @Riokmij!

• You can replace the ==0's with <1, change the declaration of s with var instead of string, and replace the call to .ToString() by +"". Also, initial value for i should be 0. – Najkin Sep 29 '15 at 15:56

# MSX-BASIC, 106 bytes

1FORI=1TO100:IFIMOD3=0ANDIMOD5=0THEN?"FizzBuzz"ELSEIFIMOD3=0THEN?"Fizz"ELSEIFIMOD5=0THEN?"Buzz"ELSE?I
2NEXT


The one-liner version to be executed in direct mode would be 120 bytes because all of the extra NEXTs needed before the ELSEs:

FORI=1TO100:IFIMOD3=0ANDIMOD5=0THEN?"FizzBuzz":NEXTELSEIFIMOD3=0THEN?"Fizz":NEXTELSEIFIMOD5=0THEN?"Buzz":NEXTELSE?I:NEXT

• IFIMOD3=0ANDIMOD5=0 -> IFIMOD15=0? I think MSX BASIC could be tokenized too, which would decrease your byte count. – lirtosiast Sep 30 '15 at 14:53

# rs, 92 91 bytes

(_)^^(100)
+^(_+)(_)/\1 \1\2
\b((___)+)\b/Fi;\1
\b(_{5})+\b/Bu;
;_*/zz
\b(_+)\b/(^^\1)
/\n


Saved 1 byte thanks to @MartinBüttner!

Live demo. (It may take a bit to run!)

• Do you not have \0 in rs? You can probably save some bytes either way by using the trick from my Retina answer: \b((___)+)\b/Fi;\1 ... \b(_{5})+\b/Bu; ... ;_+/zz – Martin Ender Sep 28 '15 at 14:38
• @MartinBüttner Thanks! I updated the post. What exactly do you mean by \0? – kirbyfan64sos Oct 1 '15 at 19:44
• Something to reference the entire match, not just a capturing group. – Martin Ender Oct 1 '15 at 19:59
• @MartinBüttner I guess not. :( – kirbyfan64sos Oct 1 '15 at 20:05
• @MartinBüttner I'm just using Python's built-in substitution thing. I can easily override it, though... – kirbyfan64sos Oct 1 '15 at 20:06

# O, 53 52 bytes

I'm sure that there will be a better way to do this. Thanks to kirbyfan64sos for the implicit J.

"Buzz"JA.*1mrl{.3%{.5%{}{;J}?}{"Fizz"\5%{}{J+}?}?p}d


Try it here

## Minkolang, 50 bytes

"d"[i1+d5%6&"Buzz"0c3%6&"Fizz"I1-3&N6@0gx(O)25*O].


Try it here.

### Explanation

"d"[...].        For loop that loops from 0 to 99, then stops
i1+              Loop counter + 1 (so it's 1 to 100)
d5%6&"Buzz"      Divisibility test by 5, skips "Buzz" if not divisible
0c3%6&"Fizz"     Divisibility test by 3, skips "Fizz" if not divisible
I1-              Length of stack minus 1 (0 if there's no Fizz or Buzz)
3&N6@            Output as integer if ^ is 0, skip character output otherwise
0gx(O)           Dump the loop counter and output "Fizz"/"Buzz"/"FizzBuzz"
25*O             Print newline


# Swift, 75 bytes

for n in 1...100{print(n%3*n%5>0 ?n:(n%3>0 ?"":"Fizz")+(n%5>0 ?"":"Buzz"))}


# F#, 129116113 111

Seq.iter(fun x->printfn"%s"(["Fizz";"";""].[x%3]+(if x%5=0 then"Buzz"elif x%3>0 then string x else""))){1..100}


# scg, 51 bytes

1á01°r{d[[d"Buzz"]["Fizz"d"Buzz"+]]\3%!@\5%!@"
"}m


So, does this mean that scg is a real language now? Explanation:

1                         .- adds 1 to the stack
á01                      .- adds 101 to the stack
°r                    .- range, adds array with 1-100 on the stack
{                   .- start function for use in map
d                  .- duplicates number
[                  .- array
[
d                .- duplicate number again, ends up in array
"Buzz"          .- wonder what this does
]         .- end array
[
"Fizz"
d          .- duplicate fizz
"Buzz"+          .- ends up with "FizzBuzz"
]
]        .- end array. Ends up with a 2D array
\                 .- gets number to calculate to the top
3%                .- mod 3
!               .- not, so any above 0 int turns to 0 and 0 turns to1
@              .- get array value. Now you have two choices for output
\5%!@         .- same as above but for 5.
.- now we have the correct fizzbuzz value
"\n"     .- pushes newline. I do not have variables yet so no shortcuts
}m   .- end function, map. output is implicit


# 𝔼𝕊𝕄𝕚𝕟, 32 chars / 47 bytes

⩥ṤⓜᵖFizzBuzzė⧺_%3⅋4,_%5?4:8)⋎_


Try it here (Firefox only).

# C#, 174 bytes

void A(){for(int x=1;x<101;x++){if(x%15<1)Console.Write("FizzBuzz\n");else if(x%3<1)Console.Write("Fizz\n");else if(x%5<1)Console.Write("Buzz\n");else Console.WriteLine(x);}}


Ungolfed:

void A(){
for (int x = 1; x < 101; x++) {
if (x % 15 < 1) Console.Write("FizzBuzz\n");
else if (x % 3 < 1) Console.Write("Fizz\n");
else if (x % 5 < 1) Console.Write("Buzz\n");
else Console.WriteLine(x);
}
}


# Mathematica, 103 86 73 bytes

With 30 bytes saved thanks to @A Simmons!

f="Fizz";b="Buzz";Range@100/.{x_/;15∣x->f<>b,x_/;3∣x->f,x_/;5∣x->b}

• You can use g=Divisible instead of the function definition, there's a leading space (and another one right after f<>b,), and you can use x~g~15 instead of x~g~3&&x~g~5. So f="Fizz";b="Buzz";g=Divisible;Range@100/.{x_/;x~g~15->f<>b,x_/;x~g~3->f,x_/;x~g~5->b} – CalculatorFeline Mar 2 '16 at 16:28
• You can use f="Fizz";b="Buzz";Range@100/.{x_/;15∣x->f<>b,x_/;3∣x->f,x_/;5∣x->b} for 73 bytes in 67 characters. – A Simmons Mar 2 '16 at 17:51
• CatsAreFluffy, It turns out that your code gives incorrect answers for 5 and 100, for example. – DavidC Mar 2 '16 at 22:28
• It's a pair of zero width characters right after the g. Here's code for correcting that: FromCharacterCode[ToCharacterCode@#/.{8204|8203->(##&[])}]&` (Don't worry, no zero widths here.) – CalculatorFeline Mar 2 '16 at 22:34