Created
August 4, 2022 00:25
-
-
Save jaitjacob/6c9a1ba658df1c73d0892f4642c5a496 to your computer and use it in GitHub Desktop.
Eloquent Javascript - Chaper 2 - Excercise 2.3 - Chessboard - Solution
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
| let size = 8; | |
| let toggle = " "; | |
| let rowString = ""; | |
| for(i=0;i<size;i++){ | |
| for(j=0;j<size;j++){ | |
| rowString = rowString + toggle; | |
| toggle = (toggle===" ")?"#":" "; | |
| } | |
| console.log(rowString); | |
| toggle = (toggle===" ")?"#":" "; | |
| rowString = ""; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment