The resulting 2D list represents a board where rows 0, 1, 2 and 5, 6, 7 are completely filled with 1s, creating the "v1" pattern required for the exercise.
if ((row + col) % 2 == 0)
, draw color A. Otherwise, draw color B. This ensures that even if you have an even number of columns, the next row starts with the "opposite" color.
Here is a clean, "fixed" implementation for the CodeHS environment: javascript
The resulting 2D list represents a board where rows 0, 1, 2 and 5, 6, 7 are completely filled with 1s, creating the "v1" pattern required for the exercise.
if ((row + col) % 2 == 0)
, draw color A. Otherwise, draw color B. This ensures that even if you have an even number of columns, the next row starts with the "opposite" color. 916 checkerboard v1 codehs fixed
Here is a clean, "fixed" implementation for the CodeHS environment: javascript The resulting 2D list represents a board where