In the past I’ve programmed in Basic, Pascal, Assembly Language, Fortran, Cobol, C, Java, Flash (does that count?), Shell Scripts, Quel, ABF, HTML, SQL, Perl, PSQL, PL/SQL and probably a few more if I really think about it and it seems that I’m not particularly unusual. A few of us at work decided to see how many ways we could program the FizzBuzz game. I submitted a couple of entries – one in PL/SQL and another in LOLCode:
SET SERVEROUTPUT ON FORMAT WRAPPED
WHILE (i <= 100) LOOP
str := CHR(10);
i := i+1;
IF (MOD(i,3) = 0) THEN
IF (MOD(i,5) = 0) THEN
str:= str || ‘Buzz’;
BTW Go Here for more on LOLCode – http://progopedia.com/language/lolcode/
CAN HAS STDIO?
I HAS A LIMIT ITZ 100
I HAS A LOOPYCOUNT ITZ 0
I HAS A NUFFIN ITZ 0
I HAS A STRING
BTW LOLCats love string
IM IN YR LOOP UPPIN YR LOOPYCOUNT TIL BOTH SAEM LOOPYCOUNT AN LIMIT
I HAS A NUM ITZ MOD OF LOOPYCOUNT AN 3
SAEM NUM AN NUFFIN, O RLY?
I HAS A NUVVERNUM ITZ MOD OF LOOPYCOUNT AN 5
SAEM NUVVERNUM AN NUFFIN, O RLY?
YA RLY, STRING R ‘FizzBuzz’
NO WAI, STRING R ‘Fizz’
I HAS A NUVVERNUVVERNUM ITZ MOD OF LOOPYCOUNT AN 5
SAEM NUVVERNUVVERNUM AN NUFFIN, O RLY?
YA RLY, STRING R ‘Buzz’
NO WAI, STRING R ‘ ‘
IM OUTTA YR LOOP
(actually, and somewhat surprisingly, I think my LOLCode is better than my PL/SQL as I should really have used a FOR LOOP instead of a WHILE loop).
Anyhow, other people submitted their examples in their favourite language and we had quite a list before someone pointed out that this had already done and to a ridiculous extent. Take a wander here and be truly amazed. My favourite is probably whitespace but there are some others that will probably make you smile too.