Skip to content

Instantly share code, notes, and snippets.

@kknights
Created August 25, 2015 19:32
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 kknights/da72c337616f4c673f1f to your computer and use it in GitHub Desktop.
Save kknights/da72c337616f4c673f1f to your computer and use it in GitHub Desktop.
EJ - Chessboard
// Chessboard
var size = 8;
for (var i = 0; i < size; i++) {
var row = "";
for (var j = 0; j < size; j++) {
var total = i + j;
if (total % 2 == 0) {
row += '#';
} else {
row += ' ';
}
}
console.log(row);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment