Skip to content

Instantly share code, notes, and snippets.

@tuckcodes
Created December 22, 2018 07:08
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 tuckcodes/60c8827f62d796a5e523e3108d99bbbb to your computer and use it in GitHub Desktop.
Save tuckcodes/60c8827f62d796a5e523e3108d99bbbb to your computer and use it in GitHub Desktop.
Make a chess board kinda thing with a row amount parameter
// Chess Board
// Create a chess board with a congigurable row amount parameter
let size = prompt(Number("How many rows?")), board = "# # # #";
for (let count = 0; count < size; count++) {
if (count%2==0) {
console.log(" " + board)
} else {
console.log(board);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment