Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 14th East European Conference Adbis 2010 Novi Sad Serbia September 2010 Proceedings Lncs 6295

Authors: Barbara Catania ,Mirjana Ivanovic ,Bernhard Thalheim

2010th Edition

3642155758, 978-3642155758

More Books

Students also viewed these Databases questions

Question

Explain the market segmentation.

Answered: 1 week ago

Question

Mention the bases on which consumer market can be segmented.

Answered: 1 week ago

Question

Explain consumer behaviour.

Answered: 1 week ago

Question

=+such as the dirigenti in Italy?

Answered: 1 week ago

Question

=+ Are there closed-shop requirements or practices?

Answered: 1 week ago