Comments on 1, 2, Fizz, 4, Buzz!
Parent
1, 2, Fizz, 4, Buzz!
The task
Output the first 100 elements of the infamous FizzBuzz sequence.
How?
The FizzBuzz sequence is the sequence of decimal integers from 1 to 100 inclusive, but:
- If the integer is divisible both by 3 and 5, output the string
FizzBuzz
- Else, if the integer is divisible by 3, output the string
Fizz
instead - Else, if the integer is divisible by 5, output the string
Buzz
instead - Else, output the integer itself
Output
The output will be a list of these elements separated by either a space (U+0020
) or a newline (U+000A
).
Here is a sample output with newline separation:
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
Rules
- Your code may not print anything to STDERR. Warnings are fine.
- This is code-golf, so lowest byte-count in each language is the winner.
C (gcc), 113 Bytes ``` i;mai …
4y ago
[RoadLang], 340 bytes ` …
4y ago
goruby, 1 byte ```ruby f …
4y ago
[JavaScript (Node.js)], 64 byt …
4y ago
[Shakespeare Programming Langu …
4y ago
C (gcc), 108 bytes ```c h, …
4y ago
Japt `-R`, 28 bytes Lõ@ …
4y ago
[AWK], 72 bytes BEGIN{f …
3y ago
Japt `-R`, 27 bytes Lõ@ …
3y ago
Canvas, 24 bytes zz+¹┘%!* …
4y ago
Vyxal `Hj`, 10 bytes …
3y ago
[C (gcc)], 103 bytes Using …
3y ago
[shortC], 95 93 91 bytes …
3y ago
[Haskell], 110 bytes …
3y ago
[Python 3], 64 62 bytes …
3y ago
[Lua], 126 118 bytes …
3y ago
[Julia 1.0], 79 bytes …
3y ago
Rockstar, 138 135 133 bytes …
3y ago
Sclipting, (UTF-16) 62 bytes …
3y ago
[AWK], 62 61 60 56 bytes …
5mo ago
[PHP], 114 bytes Ph …
3y ago
Post
Shakespeare Programming Language, 11232 bytes
My last attempt was nearing the 20000 byte zone, because it didn't use the stack at all.
a.Ajax,.Puck,.Ford,.Act I:.Scene I:.[Enter Ajax and Puck]Ajax:You is twice the sum ofa cat a big big cat.Puck:You is the sum oftwice the sum ofthe cube ofa big big cat a big pig a big pig.Scene V:.[Exeunt][Enter Ajax and Puck]Puck:Remember you!Remember you!Remember the sum ofthe sum ofyou a big big pig a pig!Remember the sum ofthe cube ofa big big cat a big cat!Remember me!Remember you!Remember you!Remember the sum ofthe sum ofyou a big big big big pig a pig!Remember the sum oftwice the sum ofa big cat a cat the cube ofa big big cat!Remember me!Remember me!Remember me!Remember you!Remember you!Remember the sum ofthe sum ofyou a big big big big pig a pig!Remember the sum oftwice the sum ofa big cat a cat the cube ofa big big cat!Remember me!Remember you!Remember you!Remember the sum ofthe sum ofyou a big big pig a pig!Remember the sum ofthe cube ofa big big cat a big cat!Remember me!Remember me!Remember you!Remember you!Remember the sum ofthe sum ofyou a big big big big pig a pig!Remember the sum oftwice the sum ofa big cat a cat the cube ofa big big cat!Remember me!Remember me!Remember me!Remember you!Remember you!Remember the sum ofthe sum ofyou a big big pig a pig!Remember the sum ofthe cube ofa big big cat a big cat!Remember you!Remember you!Remember the sum ofthe sum ofyou a big big big big pig a pig!Remember the sum oftwice the sum ofa big cat a cat the cube ofa big big cat!Remember me!Remember me!Remember me!Remember you!Remember you!Remember the sum ofthe sum ofyou a big big big big pig a pig!Remember the sum oftwice the sum ofa big cat a cat the cube ofa big big cat!Remember me!Remember me![Exit Ajax][Enter Ford]Puck:You is the sum ofyou a cat!Be you worse twice the sum ofa big cat a cat?If soLet usScene V![Exit Ford][Enter Ajax]Puck:Remember you!Remember you!Remember the sum ofthe sum ofyou a big big pig a pig!Remember the sum ofthe cube ofa big big cat a big cat!Remember me!Remember you!Remember you!Remember the sum ofthe sum ofyou a big big big big pig a pig!Remember the sum oftwice the sum ofa big cat a cat the cube ofa big big cat!Remember me!Remember me!Remember me!Remember you!Remember you!Remember the sum ofthe sum ofyou a big big big big pig a pig!Remember the sum oftwice the sum ofa big cat a cat the cube ofa big big cat!Remember me!Remember you!Remember you!Remember the sum ofthe sum ofyou a big big pig a pig!Remember the sum ofthe cube ofa big big cat a big cat!Remember me!Remember me!Remember you!Remember you!Remember the sum ofthe sum ofyou a big big big big pig a pig!Remember the sum oftwice the sum ofa big cat a cat the cube ofa big big cat!Remember me!Remember me!Puck:You cat!Open heart!Recall!Speak thy!You big cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You big big cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is the sum ofa big big big cat a pig!Open heart!Recall!Speak thy!You big big big cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You cat!Open heart!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is the sum ofthe sum ofa big cat a cat you!Open heart!Recall!Speak thy!You is the sum ofyou a big big cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You big big big big cat!Open heart!Recall!Speak thy!You is the sum ofa big big big big cat a cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You cat!Open heart!You is the sum ofa big big big cat a cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You big cat!Open heart!Open heart!Recall!Speak thy!You big cat!Open heart!You is the sum ofyou a cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You big cat!Open heart!You is twice the sum ofyou a cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is twice the sum ofyou a big big cat!Open heart!Recall!Speak thy!You big cat!Open heart!You is the sum ofa big big big cat a cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is the sum ofa big cat a cat!Open heart!You cat!Open heart!Recall!Speak thy!You big big big big big cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is twice the sum ofa big big big big cat a cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is the sum oftwice twice the sum ofa big big big cat a cat a cat!Open heart!Recall!Speak thy!You is twice the sum oftwice the sum ofa big big big cat a cat a cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You big big cat!Open heart!You cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You big big cat!Open heart!You is the sum ofyou a pig!Open heart!Recall!Speak thy!You big big cat!Open heart!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You big big cat!Open heart!You is the sum ofyou a big cat!Open heart!Recall!Speak thy!You big big cat!Open heart!You is the sum oftwice you a pig!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is the square ofthe sum ofa big big big cat a pig!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is the sum ofa big big cat a cat!Open heart!You big cat!Open heart!Recall!Speak thy!You is the sum oftwice the sum ofthe factorial ofa big big cat a big cat a cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is twice twice the sum ofyou a big big cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is the sum ofa big big cat a cat!Open heart!You big big big cat!Open heart!Recall!Speak thy!You is the sum ofa big big cat a cat!Open heart!You is the sum ofyou a big big cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is twice the sum ofa big cat a cat!Open heart!You cat!Open heart!Recall!Speak thy!You is the sum ofthe cube ofa big big cat a big pig!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is the cube ofa big big cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is the sum ofthe sum ofthe cube ofa big big cat a big cat a cat!Open heart!Recall!Speak thy!You is the sum ofthe cube ofa big big cat a big big cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is the sum ofa big big big cat a pig!Open heart!You cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is the sum oftwice the square oftwice the sum ofa big cat a cat a cat!Open heart!Recall!Speak thy!You is the sum oftwice the square oftwice the sum ofa big cat a cat a big cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is the sum oftwice the square oftwice the sum ofa big cat a cat a big big cat!Open heart!Recall!Speak thy!You is the sum ofa big big big cat a pig!Open heart!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is the sum ofa big big big cat a pig!Open heart!You is the sum ofyou a big cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You big big big cat!Open heart!You big cat!Open heart!Recall!Speak thy!You big big big cat!Open heart!You is the sum ofa big cat a cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You big big big cat!Open heart!You is the sum ofyou a big pig!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You big big big cat!Open heart!Open heart!Recall!Speak thy!You big big big cat!Open heart!You is the sum ofyou a cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is the sum ofa big big big cat a cat!Open heart!You cat!Open heart!Recall!Speak thy!You is the sum ofa big big big cat a cat!Open heart!You big cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is the sum ofa big big big cat a cat!Open heart!You big big cat!Open heart!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!Recall!Speak thy!You is the sum ofa big big big cat a cat!Open heart!You is the sum ofyou a big pig!Open heart!Recall!Speak thy!You is the sum ofthe square ofyou a big pig!Open heart!Ajax:You is the sum oftwice the sum ofa big big cat a cat a cat!Scene L:.Puck:Recall!Speak thy!Ajax:You is the sum ofyou a pig!Be you nicer a cat?If soLet usScene L!
Works by adding the FizzBuzz line breaks and words to the stack (in reverse) for the first 90, adds the last 10 lines, then goes through and prints all the numbers and words by recalling the stack at specific times. SPL doesn't support division so this is the shortest method I could think of, short of subtracting numbers and checking if they... equal... zero...
Oh god, I've gotta go golf more. I'm leaving this here as a mark that I've done something, though.
1 comment thread