Question: Language: Python Program required: Processing 3.0 Purpose: Familiarize yourself with some basic list syntax and usage. Degree of Difficulty: Easy For this question, the theme

Language: Python

Program required: Processing 3.0

Language: Python Program required: Processing 3.0 Purpose: Familiarize yourself with some basic

Purpose: Familiarize yourself with some basic list syntax and usage. Degree of Difficulty: Easy For this question, the theme is fun with polkadots! You'll write a program where the user can click the mouse to place circles on the canvas, and with the press of a key, all of the circles will randomly change color. Here is how your program should behave: Start with an empty 400 times 400 canvas with a light grey background When the user clicks the mouse: A new white circle appears at the location where the mouse was clicked. When the user presses the 'p' key: All of the circles on the canvas change color to a random color!(it's okay if, by random chance, a circle remains the same color as before) Here are some hints on how to design your program. Keep in mind that, as usual, sticking to the Model- View-Controller design style will make your life FAR easier! Your model will need to include some list(s) for storing the (x, y) coordinates of all the circles (similar to the planet exercise from the Chapter 14 lecture slides) Your model should also include some list(s) for storing the current color of every circle. You might want to use 3 separate lists for this - one list for each of the red, green and blue color values - or you might not. it's up to you. As a reminder, you can use the function call random(0, 256) to return a random floating point number from 0 to 255. Do this when you need to generate a random color value

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

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

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!