In the CodeHS 9.1.6: Checkerboard, v1 exercise, the objective is to create an 8x8 grid where the top three and bottom three rows contain alternating 1s and 0s (representing checker pieces), while the middle two rows consist entirely of 0s. The final result should look like this:
# Constants for the board size and square size NUM_ROWS = 8 NUM_COLS = 8 SQUARE_SIZE = 50
If you want, tell me which language or CodeHS API (console vs. graphics) you're using and I can produce a ready-to-run solution. 9.1.6 checkerboard v1 codehs
The most common mistake is simply "cheating" the output with a print statement. The CodeHS autograder specifically checks for (e.g., board[i][j] = 1 ). If you don't use these, you'll see a red error message: "You should set some elements of your board to 1." .
# Add the square to the window win.add(square) In the CodeHS 9
var size = 8; var S = 40; // pixel square size for (var r = 0; r < size; r++) for (var c = 0; c < size; c++) var x = c * S; var y = r * S; if ((r + c) % 2 === 0) fillRect(x, y, S, S); // filled square else // leave background or draw empty square
grid stored as a list of lists. Unlike a fully alternating board, version 1 requires a simplified pattern where: top three rows contain alternating pieces ( middle two rows are completely empty (all bottom three rows contain alternating pieces ( Step-by-Step Implementation 1. Initialize the 2D Grid First, create an empty list called assignment statements The most common mistake is simply
Complexity analysis: