seems to be dead ... wonder if they are running the code submitted on the webserver & people have submitted busy loops or somesuch
Hi, can you check now. It is working. We run it in our codecheckers and not on webservers.
Fizz Buzz codegolf challenge in 15 languages
21–30 of 100 posts
Re: Fizz Buzz codegolf challenge in 15 languages
#22Earlier quoted context omitted.
I'm wondering the same thing...
`console.log` works fine.
process.stdin.resume();
process.stdin.setEncoding("ascii");
process.stdin.on("data", function (input) {
var output = ''
if (input % 3 === 0){
output += 'Fizz'
}
if (input % 5 === 0){
output += 'Buzz'
}
console.log(output || input)
});
Testing locally with for(i=1;i
gives the correct results.Re: Fizz Buzz codegolf challenge in 15 languages
#23Re: Fizz Buzz codegolf challenge in 15 languages
#24Re: Fizz Buzz codegolf challenge in 15 languages
#25 #!/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 ?Re: Fizz Buzz codegolf challenge in 15 languages
#26It 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)
Re: Fizz Buzz codegolf challenge in 15 languages
#27Bit 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 ?
Re: Fizz Buzz codegolf challenge in 15 languages
#28It 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)
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 ?
Re: Fizz Buzz codegolf challenge in 15 languages
#29Bit 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 ?
In other languages n is the number between 1-100 passed into the method. The loop is outside of fizzbuzz_solve.
Re: Fizz Buzz codegolf challenge in 15 languages
#30Bit 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 ?