In , you might have created a static 8x8 board. In Checkerboard V2 , the requirements typically change in one of two ways (depending on your school’s version):
You cannot simply print the final board. You must construct the 2D list. Wrong Dimensions: Ensure it is exactly 8x8.
Ensure you're actually using an if statement to check positions 1.2.4.
for row in range(rows): for col in range(cols): # Draw square here Use code with caution. 2. Alternating Logic (The Core of V2) 9.1.7 Checkerboard V2 Codehs
// Create the canvas var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d');
Inside the nested loop, use an if-else statement paired with the modulo operator to check if the coordinates add up to an even or odd number. 3. Assign the Values
The core of this problem is the :
This public link is valid for 7 days and shares a thread, including any personal information you added. This link or copies made by others cannot be deleted. If you share with third parties, their policies apply. Can’t copy the link right now. Try again later.
0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0
Alternatively, the same logic can be written in a slightly different but functionally identical way: In , you might have created a static 8x8 board
This public link is valid for 7 days and shares a thread, including any personal information you added. This link or copies made by others cannot be deleted. If you share with third parties, their policies apply. Can’t copy the link right now. Try again later.
The Checkerboard V2 project offers significant educational value, particularly in the areas of:
# Get the dimensions from the user (or specific constants if the problem asks) width = int(input("What width? ")) height = int(input("What height? ")) Wrong Dimensions: Ensure it is exactly 8x8
checkerboard of obsidian and pearl tiles. However, Modulo was notoriously lazy and wanted a single set of instructions his apprentices could follow without him being there. 1. Designing the First Row
The exercise on CodeHS involves creating an