V2 Codehs | 9.1.7 Checkerboard
0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0
Would you like help with a specific error message or a different variation of this checkerboard problem? 9.1.7 Checkerboard V2 Codehs
The most elegant and foolproof way to determine the value of any given square is to add its and column index together. If (row + col) is even , assign one color (e.g., 0 ). If (row + col) is odd , assign the other color (e.g., 1 ). Why This Works Let's look at a small grid using coordinates (row, col) : 0 1 0 1 0 1 0 1