This file contains 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
/* This is the way I found to solve it. There are probably easier ways to do this. I am a total beginner */ | |
var boardwidth = 8, boardheight = 5, board = ""; | |
for ( i = 0 ; i < boardheight ; i++ ) { | |
for ( f = 0 ; f < boardwidth ; f++ ) { | |
if ( f % 2 === 0 ) | |
board += " "; |
This file contains 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
/* My solution to the FizzBuzz exercise */ | |
for ( i = 1 ; i <= 100 ; i++ ) { | |
if ( i % 3 === 0 && i % 5 === 0 ) { | |
console.log("FizzBuzz") | |
} | |
else if (i % 3 === 0) { | |
console.log("Fizz") |
This file contains 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
var i = 0, string = ""; | |
for ( i = 0 ; i < 7 ; i++ ) { | |
string += "#" | |
console.log(string) | |
} |