Created
August 5, 2018 22:22
-
-
Save danilogila/f9a9294ce3ff2e034fdd48ecd2c25ad3 to your computer and use it in GitHub Desktop.
Chessboard Layout with JavaScript
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
let hash = ""; | |
let tam = 8; | |
for(let x=0;x<tam;x++){ | |
for(let y=0;y<tam;y++){ | |
if((x+y)%2==0){ | |
hash += "#"; | |
}else{ | |
hash+= " "; | |
} | |
} | |
hash+="\n"; | |
} | |
console.log(hash); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment