Artificial Intelligence Notice: ISA prohibits the entry of any ISA intellectual property (“ISA IP”), including standards, publications, training or other materials into any form of Artificial Intelligence (AI) tools, such as ChatGPT. Additionally, creating derivatives of ISA IP using AI is also prohibited without express written permission from ISA’s CEO. In the case of such use, ISA will suspend a licensee’s access to ISA IP, and further legal action will be considered. Please review ISA's policies for Use of AI Tools, Intellectual Property and Terms and Conditions for further information.

Important Notice: Print books are temporarily unavailable. As of 12 August 2025, print books are no longer available for purchase on isa.org, but beginning 1 February 2026, they will be available for purchase through our publishing partner, Wiley. Kindle and ePub formats are still available via the links on each book's product page on isa.org. Learn More.

9.1.6 Checkerboard V1 Codehs [updated] 99%

You need to create a checkerboard pattern (alternating black and red squares) using a grid of squares, typically with n rows and n columns (often n = 8 for a standard checkerboard).

To achieve this, the program must evaluate the position of each cell based on its row and column indices. Key Programming Concepts Used 9.1.6 checkerboard v1 codehs

In the CodeHS exercise , the goal is to create a 2D array representing an You need to create a checkerboard pattern (alternating

function start() // Define the size of the board var NUM_ROWS = 8; var NUM_COLS = 8; // Outer loop handles the rows for (var row = 0; row < NUM_ROWS; row++) // Inner loop handles the columns for (var col = 0; col < NUM_COLS; col++) // Check if the sum of row and col is even if ((row + col) % 2 == 0) drawSquare(row, col, Color.red); else drawSquare(row, col, Color.black); function drawSquare(row, col, color) var sideLength = getWidth() / 8; var x = col * sideLength; var y = row * sideLength; var rect = new Rectangle(sideLength, sideLength); rect.setPosition(x, y); rect.setColor(color); add(rect); Use code with caution. Key Components Explained 1. Nested Loops var NUM_COLS = 8

: Create an empty list called board and fill it with eight rows of eight zeros.