9.1.7 Checkerboard V2 Codehs __exclusive__ < 2024 >
This problem is a classic introduction to Nested Loops and Modular Arithmetic. It asks you to draw a checkerboard pattern where the color of each square depends on its position (row and column).
- Compute the x and y pixel coordinates based on square size:
console.log(line);
- Loop rows from 0 to 7.
- Loop columns from 0 to 7.
- If
(row + col) % 2 == 0→ Color A, else Color B.
Step-by-Step Solution Plan
Let’s assume the following constants (typical in CodeHS): 9.1.7 Checkerboard V2 Codehs
Pro Tip: Run your code with a board size of
4x4first to verify the pattern before scaling to8x8. This problem is a classic introduction to Nested@.@.@ .@.@. @.@.@ .@.@. @.@.@