Question
Must be done in Python: I'm also using processing version 3.3.6 For this question, you will revisit this problem by drawing full-sized checkerboards of various
Must be done in Python: I'm also using processing version 3.3.6
For this question, you will revisit this problem by drawing full-sized checkerboards of various sizes on the canvas. This time, your program must use loops and allow the user to change the size of the board with key presses.
Figure 1: Four examples of checkerboards a 2x2 board (smallest allowed), an 8x8 board (starting size), an 11x11 board (odd number) and a 16x16 board (largest allowed)
Start with a dark gray background on a 400x400 pixel canvas. Your task is to draw an N-by-N black-and- white checkerboard in Processing, where N can be any integer between 2 and 16. Have the top-leftmost tile coloured white like in the gure. You should not allow the user to make the board smaller than 2x2 or larger than 16x16. A 16x16 grid will ll the entire canvas, as seen above.
When the user presses the + key, one additional row and column should be added to the checkboard, up to the maximum of 16 rows and columns. When the user presses the - key, one row and column should be removed from the checkboard, down to the minimum of 2 rows and columns. Start the program with an 8x8 checkerboard.
For this question, you must use loops to draw the checkerboard. Your code itself must use rect() exactly once! Use loops, ranges and extra variables as needed to keep track of (a) where to draw the current square, and (b) what color the current square should be (black or white).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started