9.1.6 Checkerboard V1 Codehs
Make sure you are using Color.red and Color.gray (or whatever specific colors your assignment instructions require).
# Create an 8x8 grid of zeros board = [] for i in range(8): board.append([0] * 8) Use code with caution. Copied to clipboard 2. Apply the Checkerboard Logic 9.1.6 checkerboard v1 codehs
This exercise is designed to test your ability to work with (lists of lists) and nested for loops . A common mistake is just printing the pattern; however, the CodeHS autograder specifically checks if you have assigned the value 1 to elements within your board. 1. Initialize Your Grid Make sure you are using Color
This pattern creates the diagonal "stepping stone" look of a checkerboard. 3. Grid Management Apply the Checkerboard Logic This exercise is designed
It looks like you are working on the assignment in the CodeHS Graphics course. In this assignment, you are typically asked to write a function called create_checkerboard that draws an 8x8 grid of alternating black and white squares.
Write a program that draws a checkerboard pattern. Your program should create a canvas of 400x400 pixels. The checkerboard should have 8 rows and 8 columns of squares. Each square should be 50x50 pixels. Alternate the colors between black and gray (or red and black, depending on the version). The top-left square should be gray.
In CodeHS V1, you are often working with a Grid object. Remember that grid.set(row, col, value) is the standard syntax. If your specific assignment uses or Graphics , you would replace grid.set with putBall() or new Rect() , but the nested loop logic remains identical. Common Pitfalls