Question: Write a procedure, board, which takes a integer number as input and produces a list as an output, each element of which is a list
Write a procedure, board, which takes a integer number as input and produces a list as an output, each element of which is a list of 0s and 1s.
When board is called with a nonnegative integer, n, it returns a list containing n lists, each of which has n elements. These lists form the shape of a square board. Each of the inner lists contain only numbers 0 and 1, and they alternate across lists. The result always has 0 as the first element of the first inner list, if any.
The following examples show a formatted output of the boards, but your output does not need look the same regarding spaces. For your output, it is sufficient to produce the list. Spaces in the lists are just for illustrative purposes here; you are not required to print them:
Step by Step Solution
3.46 Rating (153 Votes )
There are 3 Steps involved in it
The problem youve presented requires creating a function that generates a square board of a given si... View full answer

Get step-by-step solutions from verified subject matter experts