Last active
August 26, 2016 19:12
-
-
Save harryadel/953788d8885091219dcf7ab48fbc358e to your computer and use it in GitHub Desktop.
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
/* | |
My answer for exercise 'Chess board' | |
in Eloquent JavaScript Second Edition | |
Chapter 2 Program Structure | |
*/ | |
var oddRow = "# # # #"; | |
var evenRow = " # # # #"; | |
for (var i = 1; i < 9; i++) { | |
if (i % 2 == 0) { | |
console.log(evenRow); | |
}else { | |
console.log(oddRow); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment