Live data from Hacker News

Fizz Buzz codegolf challenge in 15 languages

hackerrank.com

31–40 of 100 posts

Re: Fizz Buzz codegolf challenge in 15 languages

#31
post #28
post #26

Earlier quoted context omitted.

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 ?

Yes, fixing it. Can you try?

same error ..will try after some time

Update : Logged in, Takes forever to submit

Re: Fizz Buzz codegolf challenge in 15 languages

#33
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."

Re: Fizz Buzz codegolf challenge in 15 languages

#35
post #29

Earlier quoted context omitted.

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

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.

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

Re: Fizz Buzz codegolf challenge in 15 languages

#37

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 :)

Some simple ways to cut down on characters:

    for i in range(1,101):print 'FizzBuzz' if not i%15 else 'Fizz' if not i%3  else 'Buzz' if not i%5 else i

Re: Fizz Buzz codegolf challenge in 15 languages

#39

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 :)

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

derp, works better of course

Though I can't find out the score the page to test the code seems to be inaccessible if you are signed in. It just redirects you to the signed in page and the signout link is broken. Still it's a fun and cool idea

Post reply on HN