
Fizz Buzz codegolf challenge in 15 languages - rvivek
http://www.hackerrank.com/fizzbuzz
======
GregBuchholz
Login seems borked, but here's my Perl at 59 chars (141 points):

    
    
        print(($_%3?"":"Fizz").($_%5?"":"Buzz")||$_,"\n")for 1..100

~~~
rvivek
What happens on login?

~~~
GregBuchholz
I tried the github option, and the first time I tried, it barfed about
"unauthorized credentials" or some such after the redirect back from github,
bringing me to another hackerrank login page. I tried it again, and it choked
right away with the same message. Third time and it asks to "Confirm
Submission", but hung after hitting yes.

------
cookrn
Why does authorizing with github need permission to "Update my profile"?

------
Hupo
71 characters (129 points) with JavaScript. I actually wrote this quite a
while back (and have also posted it on HN before) - code golf is pretty fun
every now and then!

    
    
        for(var i=0;i++<100;console.log(((i%3?'':'Fizz')+(i%5?'':'Buzz'))||i));
    

For anyone else interested in doing code golf with JavaScript, here's a
goldmine of byte-saving techniques:

<https://github.com/jed/140bytes/wiki/Byte-saving-techniques>

~~~
xymostech
I came up with

    
    
        for(i=0;i<100;)console.log((++i%3?"":"Fizz")+(i%5?"":"Buzz")||i)
    

earlier. 64 characters, because I don't have "var ", an extra set of parens,
and a semicolon. Worse syntax, but hey, it's code golf.

~~~
Hupo
I knew I could also drop the "var ", but I like to operate within the 140bytes
challenge rules that say you're not allowed to leak into the global scope.
I'll give you the 3 chars from the parens and semicolon, though - I got caught
up with the idea of "hey, you can do this whole thing inside the for statement
itself!" back when I did this!

------
georgemcbay
Go (golang) - 157 characters/43 score

    
    
      package main
      import(o"fmt")
      func main(){s:=o.Print
      for i:=1;i<101;i++{f,b:=i%3==0,i%5==0
      if!(f||b){s(i)}else{if f{s("Fizz")}
      if b{s("Buzz")}}
      s("\n")}}
    

Compiles and runs fine but obviously not go fmt compliant. I feel bad for even
attempting it.

Seems like the score should vary by language, Go (thankfully) makes it hard to
be _too_ terse. And of course in Java you're doomed prior to writing a single
line of real logic code

~~~
tehzord
Couldn't resist:

    
    
      class Solution{public static void main(String[] a){for(int i=0;++i<101;)System.out.println(i%15==0?"FizzBuzz":i%3==0?"Fizz":i%5==0?"Buzz":i);}}
    

143 characters, 57 score

~~~
georgemcbay
Nice. Lack of the ternary operator is the big sticking point I have with
really compact Go solutions.

OTOH, in real world code I'm glad to see it gone.

Also just noticed the () on my import aren't needed, first one would have to
be a space anyway but second one can be removed to get the character count
down by one and a bit more jiggering of the if/else logic can shave another
character:

    
    
      package main
      import o"fmt"
      func main(){s:=o.Print
      for i:=1;i<101;i++{if f,b:=i%3==0,i%5==0;(f||b){if f{s("Fizz")}
      if b{s("Buzz")}}else{s(i)}
      s("\n")}}

------
mikle
fizzbuzz and challenge in the same sentence? After the last guy I interviewed
couldn't code Fibonacci or even explain how to do it, I think I lost my faith.

------
hallowtech
I don't understand why this only gets a score of 1:

    
    
        static String[] c = { "", "FizzBuzz", "Buzz", "Fizz" };
        public static void main(String[] args)
        {
            for(int i = 1; i <= 100; i++)
            {
                c[0] = ""+i;
                int f = ((int)Math.ceil((i%3)/3.0))+1;
                int b = ((int)Math.ceil((i%5)/5.0))*2;
                System.out.println(c[(f+b)%4]);
            }
        }

~~~
ricardobeat
Because it's huge and this is a code golf challenge?

~~~
hallowtech
=\ No point in trying with Java then?

~~~
Tuna-Fish
You can do some decent golfing in Java. For improvement, how about removing
all the casts, FP arithmetic, everything from Math, etc?

------
ollysb
Bit confused by the ruby version. The signature you're given is:

    
    
        #!/bin/ruby
    
        # Head ends here
        def fizzbuzz_solve n
    
        end
    
        # Tail starts here 
    

I presumed this meant you were supposed to return a value of n, fizz, buzz or
fizzbuzz for the value of n. When I tried to compile I got a score of 0
though. What are you supposed to do with the value of n, solve fizzbuzz for
1..n ?

~~~
hallowtech
In other languages n is the number between 1-100 passed into the method. The
loop is outside of fizzbuzz_solve.

~~~
ollysb
I presumed you just return the value and that the print was in the outer loop,
seems you need to include the print statement in your method.

~~~
rvivek
Sorry this is wrong. Removed the templates. You've to output from 1-100.

------
lmm
The obvious scala implementation is 160 chars and works locally, but the site
claims I score 0 for it:

    
    
         object Solution {def main(args: Array[String])=1 to 100 map {x=>System.out.print(if(x%3>0&&x%5>0)x else if(x%5>0)"Buzz" else if(x%3>0)"Fizz" else "FizzBuzz")}}

~~~
patman_h
When I tried out the site, it gave me a score of 0 for submissions that
compiled but produced the wrong output.

I've never written scala before but it looks like your logic is wrong.

Edit: I tweaked your code and got a score of 34

    
    
       object Solution {def main(args: Array[String])=1 to 100 map {x=>System.out.println(if(x%3==0&&x%5==0)"FizzBuzz" else if(x%5==0)"Buzz" else if(x%3==0)"Fizz" else x)}}

------
nappy-doo
My best C solution (scores a 96):

#define d printf(

main(i){i<101?(!(i%3)?d"Fizz"):0)|(!(i%5)?d"Buzz"):0)?d"\n"):d"%d\n",i),main(i+1):0;}

~~~
loumf
you can get rid of the !() if you reverse the ?:

    
    
      #define d printf(
      main(i){i<101?(i%3?0:d"Fizz"))|(i%5?0:d"Buzz"))?d"\n"):d"%d\n",i),main(i+1):0;}

~~~
nappy-doo
excellent, missed that. :)

------
ricardobeat
How do you get javascript to work? I tried `process.stdout.write`,
`console.log`, but the score is always zero.

Other issues:

\- The "Solve FizzBuzz" button doesn't go anywhere if you are logged in,
neither does "The Scenario" up top.

\- Forum doesn't work (please fill in all the required fields - they already
are)

\- Signout link doesn't work

~~~
dheerajrav
process.stdin.resume(); process.stdin.setEncoding('ascii');

process.stdin.on('data', function (input) { numbers = input.split("\n"); sum =
parseInt(numbers[0]) + parseInt(numbers[1]) process.stdout.write(sum+"\n");
});

this is a sample code that takes a two digit integer and prints its sum. Can
you use this format and see if it works?

------
urbanautomaton
"You Scored: 56.00000000000001". :-)

------
adambard
I don't know why I'm such a sucker for this sort of thing. I couldn't get it
to score me, but here's 104 chars of Clojure:

    
    
        (for [i(range 100):let[d #(= (mod i %) 0)]](println(cond(d 15)"FizzBuzz"(d 3)"Fizz"(d 5)"Buzz":else i)))

------
caioariede
Erlang version (more verbose):

    
    
        lists:map(fun(N)->io:fwrite("~s~n",[if N rem 15==0->"FizzBuzz";N rem 3==0->"Fizz";N rem 5==0->"Buzz";true->integer_to_list(N)end])end,lists:seq(1,100)).

------
keelzebub
It seems like an neat idea! But I'm not I'm sure if I would make whitespace
count as characters. Seem like that punishes good formatting. I also scored
56.00000000000001 :D (I tried the Perl one)

~~~
ing33k
118 for my PHP solution, will try and check if my Python skills can beat it..
btw I am not able to login and getting too many error .. HN effect ?

~~~
rvivek
Yes, fixing it. Can you try?

~~~
ing33k
same error ..will try after some time

Update : Logged in, Takes forever to submit

------
1331
Haskell - 112 bytes / 88 score

    
    
      a="Fizz"
      b="Buzz"
      i%j=mod i j==0
      f i
       |i%15=a++b
       |i%5=b
       |i%3=a
       |True=show i
      main=mapM_ (putStrLn.f) [1..100]

------
5h
seems to be dead ... wonder if they are running the code submitted on the
webserver & people have submitted busy loops or somesuch

~~~
dheerajrav
Hi,

can you check now. It is working. We run it in our codecheckers and not on
webservers.

~~~
5h
Cool, much faster now :)

------
pg_bot
Couldn't get it to run but here is my best in ruby:

1.upto(100).each {|x|s="#{'Fizz' if x%3 == 0}#{'Buzz' if x%5 == 0}";s=="" ?
p(x): p(s)}

------
ddrmaxgt37
After 10 minutes, I was able to log in, but now I can't access the fizzbuzz
page ):. Maybe I'll try later.

~~~
ddrmaxgt37
<https://www.hackerrank.com/fizzbuzz/level> redirects to
<https://www.hackerrank.com/fizzbuzz>

~~~
crodjer
Fixed. Can you try it now?

~~~
ddrmaxgt37
It works, but I can't submit. the POST to
[https://www.hackerrank.com/rest/contests/fizzbuzz/challenges...](https://www.hackerrank.com/rest/contests/fizzbuzz/challenges/fizzbuzz/submissions)
eventually times out after 10 minutes.

I can however compile and verify my solution.

------
agentultra
for(1..100){$_%15==0?print"FizzBuzz":$_%5==0?print"Buzz":$_%3==0?print"Fizz":print}

Is my best perl golf so far... wrote this one eons ago. The site doesn't seem
to work well however and it won't let me submit it. Would obviously be shorter
with "say" instead of "print."

~~~
colomon

        say (1..100).map({ $_ %% (3|5) ?? ("Fizz" if $_ %% 3) ~ ("Buzz" if $_ %% 5) !! $_ }).join("\n")
    

is my quick stab at a Perl 6 version. About the same length if I take out the
spaces (which I'd rather not!).

~~~
agentultra
Perl 6 is so cool!

I like the bit

    
    
      $_ %% (3|5)
    

A pretty nifty way to condense multiple values into a single test.

I don't always perl, but when I do sometimes I like to golf because it's fun.

------
Ozark
my best c++ solution scores 75 points with 126 characters

    
    
        #include<iostream>
        main(){for(int i=0;i++<100;){if(i%5&&i%3)std::cout<<i;std::cout<<(i%3?"":"Fizz")<<(i%5?"":"Buzz")<<'\n';}}

------
rvivek
Just added a sample output. I think some of the code snippets are missing the
"\n"

------
agentultra
See also, <http://codegolf.com>

------
aidenn0
My best malbolge version:

    
    
        bCBA@?>=<;:9876543210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"!~}|{]s9wvutsU2ponmlNjihgfedcba`_^W{[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9876543210/.n,%I)('&%$#"!~}|^zyr8vutmrqj0/mlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9876543210/.-,+*j('&%$#z@~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHAeEDCBA:?>=<;:987654321*N.n,+*)('&%$#"!~}|{zyxwvutm32ponmlkjihgfedcb[!_X]VzZYXWVUTSRQ3ONMLKJIHGFEDCB;_?!=<;:981UT43210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&f$#"!x>|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-CgGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHGFEDCBA@?>=<;:9876543210/.-,%I)('&%$#"!~}|^zyr8vutmrqj0/mlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHAeEDCBA:?>=<;:987654321*N.-,l*)('&%$#"!~}|u;:xwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJCBfeEDCBA@9>=<5Y9876543s10/.-,+*)('&%$#"!~}|u;y[wvo5mrqj0/mlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJCBfFEDCBA@?>7<;4X876/432+O/.-,+*)('g%|B"!~}|u;yxwvutsrqponmlkjihgfedcba`_^]V[ZYXWVUTSRQPImMLKJCHG@d'CB;_?!=<;:981UT43210/.-,+*)('&%$#"!~}|{z\xwvutsl2Sonmf,jihgfedcba`_^@\[ZYXQutTSRQPO1lFKJIHGFEDCBA@?>=<;:92V6543210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjiKgfedcba`Y}]\[ZYXWVUTSRQPO1lLKDIHGFEDCBA@?>=<;4X876543s10)M-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=};:9876543210/.-,+*)('&%$#"!~}|u;sxwvutsrqj0nmfkjiha'&dcb[!_^]V[ZYXWVUTSRQPONMLKJIBfFEDCBA@?>=};:9870T43210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=};:3W765432r0/.-,%I)(!&}CB"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHGFEDCBA@?>=<;:9876543210/.-,%I)('&%$d"!~}|{zyr8vutmrqj0/mlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDC<A@?>=<;:98765.RQ10/.-,+*)('&%$#z!~}|{zyxwvutsrqj0hmf,jiha`&dcba`_^]\UTxXWVUTSRQPONMLK-IHGFEDCBA@?>=<;:9876543210/.-,%I)('&%$#"!~}v{zyr8vutslqj0/mlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=};:3W76543s1*N.-,l*)('&%$#"!~}|u;:xwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9876543210/.-m+*)('~D$#"!~}|{z\xwp6tsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHGFEDCBA@?>=<;:9876543210/.-,%I)('&%$#"!~}|^zyr8vutmrqj0/mlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDC<A@?>=<;:98765.R210/.n,+*)('&%$#"!~w={zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDC<A@?>=<;:98765.R210/.n,+*)('&%$#z@~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHGFEDCBA@?>=<;:9876543210/.-,%I)('&%$#"!~}v{zyr8vutslqj0/Plkd*hgfedFba`_^]\[ZYXWVUTSRKoONMLKJ,BfeEDCBA@?>=<;:3W76543210/.-m+*)('&%${Ay~}|{zyxwvo5srqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHA@dDCBA:?>=<;:92V654-210/.-,+*)('&%$#"!~}|{zyxwp6tsrqponmlkjihgfedcEa`_^]\[ZYXQuUTMRQPONMFjJ,BfeEDCBA@?>=<;:3W76543210/.-m+*)('&%${A!~wv<zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=};:3W76543s1*N.-,l*)('&%$#"!~}|u;:xwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9y76543210/.-,%I)('&%$#"!~}|^zyr8vutmrqj0/mlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHA@dDCBA@?>=<;:9876543s10)M-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHA@dDCBA@?>=<;:9876543210/.n,+*)(!E%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHGFEDCBA@?>=<;:9876543210/.-,%I)('&%$d"!~}|{zyr8vutmrqj0/mlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHAeEDCBA:?>=<;:987654321*N.-,l*)('&%$#"!~}|u;:xwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9876543210/.-m+*)('&%$#"!~}|{zyr8vutsl2jonmlkjihgfedcb[!_X]VzZYXWV8TSRQPONMLKJIHGFED=aA@?>=6;:3WV6543210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9876543210/.-m+*)('&%$#"!~}|{zyr8vutsrqpih.lkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9876543210/.-m+*)"FE%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHGFEDCBA@?>=<;:9876543210/.-,%I)('&%$#"!~}|^zyr8vutmrqj0/Plkd*hgfedFba`_^]\[ZYXWVUTSRKoONMLKJ,BfeEDCBA@?>=<;:3W76543210/.-m+*)('&%$#"!~}|{zyr8vutsrqponmlkjihafedcb[!_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9876543210/.-m+*)"F&f$#"!x>|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHGFEDCBA@?>=<;:9876543210/.-,%I)('&}$#"!~}|{t:xqvutm32ponmlkjihgfedcb[!_^]\[TYXWVUTSRQPONMLKJIBfFEDCBA@?>=};:9870T43210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=};:3W765432r0/.-,%I)(!&}CB"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHGFEDCBA@?>=<;:9876543210/.-,%I)('&%$d"!~}|{zyr8vutmrqj0/mlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&f$#"!~}|{zyxwvutsrqpong-Njihgf_%cba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"b~w={zyxwvutsrqponPlkjihgf_%cba`_^]\[ZYXWVUTSRQPO1lLK-IHGFEDCBA@?>=<;:9876543210/.-,%I)('g%$#"!~}|{zyxq7utslqj0/mlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHAeEDCBA:?>=<;:987654321*N.-,l*)('&%$#"!~}|u;:xwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"!~`|{zyxq7utsrqponmfkjihgfedcba`Y}]\[ZYXWVUTSRQPO1lLK-IHGFEDCBA@?>=<;:9876543210/.-,%I)(h&%$#"!~}|{zs9wvutsrqponmfkjiha'&dcb[!_^]\UZYXWVUTSRQPONMLKJIBfFEDCBA@?>=<;:92V6543210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFED&BA@?>=6Z:9876543210/.n,+*#G'&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHGFEDCBA@?>=<;:9876543210/.-,%I)('&%$#"!~}|^zyr8vutmrqj0/Plkd*hgfedFba`_^]\[ZYXWVUTSRKoONMLKJ,BfeEDCBA@?>=<;:3W76543s10/.-,+*)"F&%$#"!~}|uzyr8vutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDC%A@?>=6Z:9876543210/.-,+$H('&%$#"!~}|{zyxwvutsrqjonmlkjihgfedcb[!_X]VzZYXWV8TSRQPONMLKJIHGFED=aA@?>=6;:3WV6543210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9y70T.3210/.-,+*)('&%${A!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHAeEDCBA@?!=<;:9876543210/.-,%I)(!&}CB"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=};4X87654321*/.-&J*)('&%$#"!~`v<;yxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9y1U543s10)M-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcEa`Y}]\[ZSXWVUTSRQPONMLKDhHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9876543210/.n,%I)('&%$#"!~}|^zyr8vutmrqj0/mlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHAeEDCBA:?>=<;:987654321*N.-,l*)('&%$#"!~}|u;:xwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDC%A@?>=<;:981U543210/.-,+$H('&%$#"!~}|{zyxwvutsrqjonmlkjihgfedcb[!_X]VzZYXWV8TSRQPONMLKJIHGFED=aA@?>=6;:3WV6543210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9y1U5.3210/.'K+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&f$#"!x>|u;yxwvunsrqpi/glkjihgfedcba`_^]VzZYXWV8TSRQPONMLKJIHGFED=aA@?>=6;:3WV6543210/.n,+$H(h&%$#"!~}|{zs9Zvutm32ponmlkjihgfedcb[!_^W\[TxRQuUTSRQPO1lLKJIHGFEDCBA@?>=<;:9y1UT43210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVU7rRQPONMLK-IHGFEDCBA@?>=<;:9876543210/.-,%I)('&%$#"!~}|^zyr8vutmrqj0/mlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9876543s10)M'&J*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHAeEDCBA:?>=<;:987654321*N.n,+*)('&%$#"!~}|{zyxwvutm32ponmlkjihgfedcb[!_X]VzZYXWVUTSRQ3ONMLKJIHGFEDCB;_?!=<;:981UT43210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:987654t210/.-,+*)(!E}$#"!~}|{zyr8vutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-CgAFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"!~}|{zyxwvo5srqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHGFEDCBA@?>=<;:9876543210/.-,%I)('&%$#"!~}|^zyr8vutsrkj0/mlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHAeEDCBA:?>=<;:987654321*N.-,l*)('&%$#"!~}|u;:xwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-CgGFEDC%A@?>=6Z:9876543210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHGFEDCBA@?>=<;:9876543210/.-,%I)('&%$#"!~}|^zyr8vutmrqj0/mlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-CgfFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-CgG@EDCBA@?>=<;:981U543210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHGFEDCBA@?>=<;:9876543210/.-,%I)('&%$#"!~}|^zyr8vutmrqj0/Plkd*hgfedFba`_^]\[ZYXWVUTSRKoONMLKJ,BfeEDCBA@?>=<;:3W76543210/.n,+*#G!&%$#z@~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDC%A:^>=<;:9876543210/.-m+*)('~D$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHGFEDCBA@?>=<;:9876543210/.-,%I)('&%$#"!~}|^zyr8vutmrqj0/mlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHG@dDCBA@?>=<;:3876543210/.-,+*)('&%${A!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHAeEDCBA:?>=<;:987654321*N.-,l*)('&%$#"!~}|u;:xwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLKJIHGFEDCBA@?>=<;:9876543s10/.-,+*)('&%$#"!~}|u;y[wvo5mrqj0/mlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHGFED=aA:?>=<;:981U543210/.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lLK-IHG@dDCBA@?>7[;49876543210/.-,+$H('&%$#"!~`|u;sxwvutsrqj0nmfkjiha'&dcb[!_^]\[ZYXWVUTSRQPONMLK-IHAeEDCBA@?!=<;:92V6543,+ON.-,+*)('&%$#"!~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPO1lY

~~~
tzs
I'd never heard of malbolge until last night, when it played a role in the
mystery on CBS' "Elementary" (an excellent series, BTW). Kind of weird to
encounter such an obscure language twice in under 24 hours.

------
trebor
Looks like I can't submit my code. I can run it, but not submit it.

------
jaegerpicker
for i in range(1,101): print "FizzBuzz" if i %3 == 0 and i % 5 == 0 else
"Fizz" if i % 3 == 0 else "Buzz" if i % 5 == 0 else str(i)

Scores 69 in python but the login/signup is broken :)

~~~
glomph
OK I cheated and used google and found (60 chars):

    
    
      for i in range(1,101):print'FizzBuzz'[i*i%3*4:8--i**4%5]or i
    

Pastebin of my explanation: <http://pastebin.com/raw.php?i=00Db30FF>

EDIT: ugh, sometimes I hate markdown, moved post to pastebin.

~~~
GregBuchholz
Awesomely ingenious use of math above. 59 if newlines count as 1.

    
    
        i=1
        while i<101:print'FizzBuzz'[i*i%3*4:8--i**4%5]or i;i+=1

~~~
twiceaday
I came up with a shorter way to write the first index!

    
    
      n%-3&4
    

unbelievably it works

~~~
glomph
haha, clever!

------
verdverm
89 char in c

