for i in range(8): row = [] for j in range(8): # Check if the sum of row and column indices is even if (i + j) % 2 == 0: row.append("red") else: row.append("black") board.append(row)
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." .
For further help with 2D lists, check out official resources like the CodeHS Python 3 Course Explore Page or community discussions on Reddit's r/codehs Checkerboard v2 9.1.6 checkerboard v1 codehs
In "Checkerboard v1", the standard logic is to determine the color of a square based on the sum of its row and column indices.
Use the step-by-step debugger in CodeHS to see exactly where Karel is putting beepers. for i in range(8): row = [] for
If your checkerboard is reversed, check your modulo logic ( ≠0is not equal to 0
The final world must have a checkerboard pattern of beepers. Constraints: The solution must work on varying world sizes. Why is this Challenging? For further help with 2D lists, check out
Using the parity rule (r + c) % 2 determines cell contents and yields a simple, provably correct O(n^2) algorithm. The provided textual and graphical templates adapt to typical CodeHS environments. If you supply the exact CodeHS problem text or target language/API (e.g., Java, JavaScript, CodeHS turtle), I will produce a tailored solution and classroom-ready explanation matching that context.
Once you have mastered 9.1.6 Checkerboard v1 , challenge yourself with these modifications: