Skip to content

Instantly share code, notes, and snippets.

@bogdanmoisin
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save bogdanmoisin/cb1b90a50b630bac4841 to your computer and use it in GitHub Desktop.

Select an option

Save bogdanmoisin/cb1b90a50b630bac4841 to your computer and use it in GitHub Desktop.
// Chessboard
// Your code here.
var size = 8;
var chess =" ";
for ( var i = 0; i < size; i++ ) {
for ( j = 0 ; j < size; j ++ ) {
if ( (i + j) % 2 == 0 ){
chess += "";
}
else {
chess +="#";
}
}
chess +="\n";
}
console.log(chess);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment