9.1.6 Checkerboard V1 Codehs ❲ORIGINAL × 2027❳

Once you've mastered "Checkerboard, v1," you can challenge yourself further:

Here is the complete, clean solution for the CodeHS 9.1.6 Checkerboard v1 exercise using JavaScript Graphics. javascript

Ensure you are actually changing board[i][j] = 1 rather than just printing, or you won't pass the autograder. 9.1.6 checkerboard v1 codehs

board = []

The most common mistake is simply "cheating" the output with a print statement. The CodeHS autograder specifically checks for (e.g., board[i][j] = 1 ). If you don't use these, you'll see a red error message: "You should set some elements of your board to 1." . Once you've mastered "Checkerboard, v1," you can challenge

# Pass this function a list of lists to print it as a grid def print_board ( board ): for i in range(len(board)): print( " " .join([str(x) for x in board[i]])) # 1. Start with an empty board and fill it with 0s board = [] for i in range( 8 ): board.append([ 0 ] * 8 ) # 2. Use nested loops to change 0s to 1s in the correct rows for i in range( 8 ): for j in range( 8 ): # Top 3 rows (0, 1, 2) and bottom 3 rows (5, 6, 7) if i < 3 or i > 4 : board[i][j] = 1 # 3. Print the final result print_board(board) Use code with caution. Copied to clipboard

For any given square at row r and column c (using 0-indexed tracking): x position = c * Square Size y position = r * Square Size 2. The Alternating Color Formula The CodeHS autograder specifically checks for (e

Are you using the version or the Java/Python version of CodeHS?