Time for board, write FizzBuzz program

Time for board, write FizzBuzz program.

using(StreamReader r = new StreamReader("fizzbuzzoutput.txt")
{
Console.WriteLine(r.ReadToEnd());
}

...

...

How many fizzes can you buzz before you get a stack overflow?

#include

int
main(int argc, char **argv)
{
if(argc < 2){
printf("usage: %s [ n ]\n", argv[0]);
return 1;
}
else if(argc == 3)
return 0; /* done */
else if(argc == 2){
argc = 3 + atoi(argv[1]);
return main(argc, argv);
}
argc -= 3;

if(argc%3 == 0){
if(argc%5 == 0)
printf("bucksfizz, ");
else
printf("bucks, ");
}
else if(argc%5 == 0)
printf("fizz, ");
else
printf("%d, ", argc);
return main(argc+2, argv);
}

kys

public class FizzBuzz {
public static void main(String[] args) {
for (int i = 1; i

Script kiddy

...

the fuck is that???

Sexy

bool flag = false;
bool flag1 = false;
bool flag2 = false;
bool flag3 = false;
bool flag4 = false;
int num = 1;
Label0:
int num1 = 302782211;
while (true){
switch (num1 ^ 302782217){
case 0:{ Console.WriteLine(num); num1 = 302782216; continue; }
case 1:{ num1 = 302782210; continue; }
case 2:{ num1 = 302782213; continue; }
case 3:{ num1 = 302782216; continue; }
case 4:{ num1 = (flag4 ? 302782215 : 302782217); continue; }
case 5:{ num1 = 302782216; continue; }
case 6:{ flag2 = flag & flag1; num1 = 302782234; continue; }
case 7:{ flag = num % 3 == 0; flag1 = num % 5 == 0; num1 = 302782223; continue; }
case 8:{ Console.WriteLine("FizzBuzz"); num1 = 302782219; continue; }
case 9:{ flag3 = flag; num1 = 302782212; continue; }
case 10:{ num1 = 302782235; continue; }
case 11:{ num++; num1 = 302782235; continue; }
case 12:{ num1 = 302782216; continue; }
case 13:{ num1 = (flag3 ? 302782214 : 302782232); continue; }
case 14:{ Console.WriteLine("Buzz"); num1 = 302782220; continue; }
case 15:{ Console.WriteLine("Fizz"); num1 = 302782218; continue; }
case 16:{ goto Label0; }
case 17:{ flag4 = flag1; num1 = 302782221; continue; }
case 18:{ if (num

for i in range(100):
fizz = "" if i%3 else "fizz"
buzz = "" if i%5 else "buzz"
print(fizz+buzz if fizz or buzz else i)

hey?? is this ok?? thx

Are you too dense to understand the purpose of whiteboard coding?

It's supposed to take away syntax highlighting and any other crutches your editor / IDE provides.

>too blind to see the different colored pencils

>range(100)
F.

What, is the range supposed to be different?
I never bothered to remember the exact rules.

xrange

How do you write in a language and not know its number position? Python has zero-based numbering. E.g. lst[0] is in fact the first index.

It's python3, range is the old xrange.

I'm not talking about the language, I'm talking about the rules of fizzbuzz.
I have no idea at which number it's supposed to start, and I even had to read the above posts to figure out the 3 & 5.

for (int i = 1; i < 100; ++i) {
int fizz = i % 3 == 0;
int buzz = i % 5 == 0;

if (fizz || buzz) {
if (fizz) printf("fizz");
if (buzz) printf("buzz");
printf("\n");
} else {
printf("%d\n", i);
}
}

Rate me on my sins

base64 -d | gunzip

> autistic enough to syntax highlight by hand

This isn't ALGOL 60 bruh.

...

var
i: Integer;

begin
for i := 1 to 100 do
begin
if ((i mod 3) and (i mod 5)) = 0 then
Writeln('FizzBuzz');
if (i mod 3) = 0 then
Writeln('Fizz')
else if (i mod 5) = 0 then
Writeln('Buzz')
else
Writeln(i);
end;
Readln();
end.

#include

#define N if (printf ("%d\n", n++) < 0) goto error
#define PRINT(s) if (printf (s"\n") < 0) goto error; n++
#define FIZZ PRINT ("fizz")
#define BUZZ PRINT ("buzz")
#define FIZZBUZZ PRINT ("fizzbuzz");

int main (void) {
int n;
n = 0;
loop:
FIZZBUZZ;
N;
N;
FIZZ;
N;
BUZZ;
FIZZ;
N;
N;
FIZZ;
BUZZ;
if (n == 101) goto end;
N;
FIZZ;
N;
N;
goto loop;
end:
return 0;
error:
fprintf (stderr, "failed to printf\n");
return 1;
}

Here you go:
let o = (i) => {console.log(i % 15 == 0 ? 'FizzBuzz' : (i % 5 == 0 ? 'Buzz' : (i == 0 % 3 ? 'Fizz' : i))); i < 100 ? o(i += 1) : () => {}}; o(1)

oops little typo here's the correct one:
let o = (i) => {console.log(i % 15 == 0 ? 'FizzBuzz' : (i % 5 == 0 ? 'Buzz' : (i % 3 == 0 ? 'Fizz' : i))); i < 100 ? o(i += 1) : () => {}}; o(1)

Here's actual whiteboard coding

Compiled on free mode. Dirty as fuck but it works.
IDENTIFICATION DIVISION.
PROGRAM-ID. FIZZBUZZ.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 FIZZ PIC S9(4) BINARY.
01 BUZZ PIC S9(4) BINARY.
01 TRASH PIC S9(4) BINARY.
01 I PIC S9(4) BINARY.
PROCEDURE DIVISION.
PERFORM VARYING I FROM 1 BY 1
UNTIL I > 100
DIVIDE I BY 3 GIVING TRASH REMAINDER FIZZ
DIVIDE I BY 5 GIVING TRASH REMAINDER BUZZ
IF FIZZ = ZERO AND BUZZ = ZERO
DISPLAY 'FIZZBUZZ'
ELSE IF FIZZ = ZERO
DISPLAY 'FIZZ'
ELSE IF BUZZ = ZERO
DISPLAY 'BUZZ'
ELSE DISPLAY I
END-IF
END-IF

END-PERFORM.
STOP RUN.

0/10 you failed.

>syntax highlighting
>a crutch
I think the purpose is to show if how well you can hold the solution in your memory actually

here!

sorry forgot to print a seperator, just add a printf \n at the end of a loop..