Are you required to use specified by your teacher's instructions?
Ready to tackle the 9.1.6 Checkerboard V1? Here's a step-by-step guide to help you get started:
// Determine the color based on parity if ((row + col) % 2 == 0) square.setFillColor(Color.GRAY); else square.setFillColor(Color.BLACK);
for these requirements, or are you looking for the logic behind Checkerboard v2
The code uses two loops. The outer loop ( for row in range(8) ) iterates through the 8 rows. For each row, it creates a new, empty list ( row_list ). The inner loop ( for column in range(8) ) then iterates through the 8 columns in the current row. 9.1.6 checkerboard v1 codehs
To build the checkerboard, your program needs to solve two main problems: positioning the squares and determining their colors. 1. Grid Coordinate Math
What or unexpected visual patterns you are currently running into?
The objective is to create a grid of alternating colored squares (usually black and white) resembling a classic checkerboard.
The goal of the exercise in CodeHS is to create a 2D array representing an Are you required to use specified by your
# Check if the row is in the top 3 (index 0,1,2) OR bottom 3 (index 5,6,7) if row < 3 or row > 4: # Fill the entire row with 1s for col in range(8): current_row.append(1) else: # Fill the entire row with 0s (for middle rows 3 and 4) for col in range(8): current_row.append(0)
Ensure your position math uses (col * radius * 2) . If you just use radius , they will all stack on top of each other.
Are you using the version or the Java/Python version of CodeHS?
Once you've mastered "Checkerboard, v1," you can challenge yourself further: The outer loop ( for row in range(8)
# Determine the color based on the sum of row and col indices # If the sum is even, it's one color; if odd, it's the other. if (row + col) % 2 == 0: square.set_color(Color.black) else: square.set_color(Color.white)
Make sure you are using Color.red and Color.gray (or whatever specific colors your assignment instructions require).
: Use a for loop to go through each row index ( i ) and column index ( j ).
Are you required to use specified by your teacher's instructions?
Ready to tackle the 9.1.6 Checkerboard V1? Here's a step-by-step guide to help you get started:
// Determine the color based on parity if ((row + col) % 2 == 0) square.setFillColor(Color.GRAY); else square.setFillColor(Color.BLACK);
for these requirements, or are you looking for the logic behind Checkerboard v2
The code uses two loops. The outer loop ( for row in range(8) ) iterates through the 8 rows. For each row, it creates a new, empty list ( row_list ). The inner loop ( for column in range(8) ) then iterates through the 8 columns in the current row.
To build the checkerboard, your program needs to solve two main problems: positioning the squares and determining their colors. 1. Grid Coordinate Math
What or unexpected visual patterns you are currently running into?
The objective is to create a grid of alternating colored squares (usually black and white) resembling a classic checkerboard.
The goal of the exercise in CodeHS is to create a 2D array representing an
# Check if the row is in the top 3 (index 0,1,2) OR bottom 3 (index 5,6,7) if row < 3 or row > 4: # Fill the entire row with 1s for col in range(8): current_row.append(1) else: # Fill the entire row with 0s (for middle rows 3 and 4) for col in range(8): current_row.append(0)
Ensure your position math uses (col * radius * 2) . If you just use radius , they will all stack on top of each other.
Are you using the version or the Java/Python version of CodeHS?
Once you've mastered "Checkerboard, v1," you can challenge yourself further:
# Determine the color based on the sum of row and col indices # If the sum is even, it's one color; if odd, it's the other. if (row + col) % 2 == 0: square.set_color(Color.black) else: square.set_color(Color.white)
Make sure you are using Color.red and Color.gray (or whatever specific colors your assignment instructions require).
: Use a for loop to go through each row index ( i ) and column index ( j ).