-
-
Save eddyruiz/413952035facbb11eb300f4b100f81f1 to your computer and use it in GitHub Desktop.
A saved mob programming session with Learn Teach Code!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // CODE CHALLENGE: | |
| // Fizz buzz: print 1 to 1000, but replace every multiple of | |
| // 3 with "fizz", every multiple of 5 with "buzz", | |
| // and any multiple of 3 AND 5 with "fizzbuzz" | |
| // TO RUN THE CODE: | |
| // Copy-paste it into something like REPL.it and test it =P | |
| // in JavaScript: | |
| for(var count=1; count<1000; count++) { | |
| if (count % 3 === 0) { | |
| console.log("fizz"); | |
| } else if (count % 5 === 0) { | |
| console.log("buzz"); | |
| } else if (count % 5 === 0 && count % 3 === 0) { | |
| console.log("fizzbuzz"); | |
| } else { | |
| console.log(count); | |
| } | |
| } | |
| //java | |
| for(counter=1; counter<1000;counter++{ | |
| if (counter%3==0 &&counter%5!=0) | |
| }) | |
| {% for i in superheroes %} | |
| {{superheroes}} | |
| {% endfor %}} | |
| count = 1 | |
| while count | |
| String a; | |
| String b; | |
| String c; | |
| int a; | |
| for() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment