Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Language: Python Software: Processing Purpose: To practice using loops. To revisit an old problem with new tools. Degree of Difficulty: Easy For Assignment 1 you
Language: Python
Software: Processing
Purpose: To practice using loops. To revisit an old problem with new tools. Degree of Difficulty: Easy For Assignment 1 you drew a4x4 checkerboard of black-and-white squares. Back then, the code to do this was rather tedious you needed to write a call to rectfor every square or maybe for every 2nd square. depending on your approach) on the board. For this question, you will revisit this problem by drawing a full-sized 8x8 checkerboard on the canvas. But this time, you will use loops to do it Figure 2: An 8x8 black and white checkerboard Your task is to draw a 8x8 black and white checkerboard in Processing that fills the entire space of a 200x200 pixel canvas. Have the top-left most tile coloured white like in the figure. Your solution is not an interactive program, so you won't need to use functions like setup or dra) For this question, you must use loops to draw the checkerboard. Your code itself should contain only a single call to the rect function. Use loops 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). Hint: When you did this question for A1, you may have used setting the background color to either white or black as a shortcut to avoid extra calls to rect. Now that you are using loops. you will probably find that same shortcut just makes your logic more complicated to follow (and won't make your code any shorter anyway), so you might want to avoid it. It's up to you though What To Hand In: Your Processing sketch folder (named a6q2 compressed as a zip file (.zip). This folder should contain your Processing program as a pyde file with the same name as the folder ie.a62.pyde) and a sketch.properties project file .O marks for submitting nothing and/or files that cannot be opened. . 1 mark for correct visual output 2 marks for correct use of loops to draw an 8x8 grid. There must be only 1 call to rect) in the code. 1 mark for code that correctly alternates the color of the squares 1 mark for good code documentation with commentsStep 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