Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 valueStep 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