Fizz Buzz codegolf challenge in 15 languages
11–20 of 100 posts
Re: Fizz Buzz codegolf challenge in 15 languages
#12The 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")}}
Re: Fizz Buzz codegolf challenge in 15 languages
#13The 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")}}
Re: Fizz Buzz codegolf challenge in 15 languages
#14The 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")}}
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)}}Re: Fizz Buzz codegolf challenge in 15 languages
#15seems to be dead ... wonder if they are running the code submitted on the webserver & people have submitted busy loops or somesuch
Re: Fizz Buzz codegolf challenge in 15 languages
#16seems to be dead ... wonder if they are running the code submitted on the webserver & people have submitted busy loops or somesuch
can you check now. It is working. We run it in our codecheckers and not on webservers.
Re: Fizz Buzz codegolf challenge in 15 languages
#17Re: Fizz Buzz codegolf challenge in 15 languages
#18 static String[] c = { "", "FizzBuzz", "Buzz", "Fizz" };
public static void main(String[] args)
{
for(int i = 1; i Re: Fizz Buzz codegolf challenge in 15 languages
#19I 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
Re: Fizz Buzz codegolf challenge in 15 languages
#20How 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
I'm wondering the same thing...