Skip to content

Instantly share code, notes, and snippets.

@danilogila
Created August 5, 2018 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danilogila/f9a9294ce3ff2e034fdd48ecd2c25ad3 to your computer and use it in GitHub Desktop.
Save danilogila/f9a9294ce3ff2e034fdd48ecd2c25ad3 to your computer and use it in GitHub Desktop.
Chessboard Layout with JavaScript
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