- See more at: http://blogtimenow.com/blogging/automatically-redirect-blogger-blog-another-blog-website/#sthash.YsVbCxL0.dpuf Journey to Becoming a Web Developer: Fizzbuzz

Thursday, November 14, 2013

Fizzbuzz

I'm having some git issues, so I'm just going to take a screen shot of my code and of the solution that differs.




In my solution I used next because when I tried it not using next it kept printing 0, so I used the code on line 1 and it omitted it. The code on line 4 says that if i has no reminder when divided by 3 and 5 it should print "fizzbuzz". I wrote the code on the bottom at first but because the other two conditions were already met it didn't work. Once I changed the order it worked.








The solution above I got from gist. This solution differs from mine. This solution uses a .each iterator and it puts the whole code in one block. Also this solution using 15 instead of 3 and 5.

No comments:

Post a Comment