9.1.7 Checkerboard V2 Codehs [2021] May 2026
The CodeHS 9.1.7: Checkerboard V2 exercise is a fundamental lesson in manipulating 2D lists (nested lists) using nested for loops. While Version 1 often focuses on just filling the board, Version 2 requires a more complex logic: creating a alternating pattern of 0s and 1s, similar to a physical checkerboard. 🛠️ Problem Logic
Common Issues & Fixes
- Squares not aligning: Ensure starting X/Y are correct (often
0,0or centered) - Wrong colors: Check if your colors are spelled correctly (
"red","black", etc.) - Incorrect pattern: Verify the
(row + col) % 2logic - Missing graphics import: Make sure you're in a graphics program (not console)
Step-by-Step Solution Plan
Let’s assume the following constants (typical in CodeHS): 9.1.7 Checkerboard V2 Codehs
You will need one loop for the rows and another inside it for the columns. javascript The CodeHS 9
private static final int ROWS = 8;
private static final int COLS = 8;
private static final int SQUARE_SIZE = 50;
- Grid size: The 8x8 grid size provides a clear and recognizable checkerboard pattern. However, students may experiment with different grid sizes to explore how the pattern changes.
- Color selection: The choice of black and white as the primary colors provides a high-contrast and visually striking pattern. Students may choose to experiment with other color combinations to create different effects.
- Symmetry: The checkerboard pattern relies on symmetry to create a sense of order and balance. Students must ensure that their implementation maintains this symmetry.
9.1.7 Checkerboard, v2 I got this wrong, and I can't ... - Brainly Squares not aligning : Ensure starting X/Y are