subject

You will write a program that generates random drawings that can be drawn using the shape painter.

The shape painter consumes a drawing file where each line corresponds to a rectangle or circle shape that is part of the drawing. A line in a drawing file has the following structures:

Circle; 80, 72; 15; 32, 208, 86
Rectangle; 145, 106; 421, 274; 32, 208, 205
The first line would draw a circle with a center point at coordinate (80, 72), a radius of 15, and a fill color with 32 for the red intensity, 208 for the green intensity, and 86 for the blue intensity. The second line would draw a rectangle with an upper left corner at coordinate (145, 106), a lower right corner at coordinate (421, 274), and a fill color with 32 for the red intensity, 208 for the green intensity, and 205 for the blue intensity.

Your goal is to create a program that generates drawing files by randomly creating these shape lines. A user should input, in this order

the name of the file to write the shape lines out to
the number of shapes to generate and write to the file as lines.
For each line to be written into the drawing output file, your program should randomly choose:

the shape type
the corresponding Point coordinates: currently the shape painter assumes the window size is 500 pixels wide by 500 pixels tall so you should only generate Point coordinate values that will remain within those bounds
a fill color: you should not randomly generate each intensity color for the full range of 0 to 255. In order to make your drawings more attractive, you should use smaller ranges of intensity values, and those smaller ranges are up to you. For example, you could randomly select blue intensity values in the range 192 to 255.
any other necessary values (e. g., the radius of a Circle).
An example interaction:

Enter the drawing file name to create: d3.txt
Enter the number of shapes to make: 30
This will write 30 shape lines to the file `d3.txt`. A sampling of those lines:

Rectangle; 127, 143; 318, 332; 32, 208, 253
Circle; 302, 323; 15; 32, 208, 255
Circle; 458, 253; 47; 32, 208, 129
Circle; 80, 72; 15; 32, 208, 86
Rectangle; 145, 106; 421, 274; 32, 208, 205
The user should then be able to open that file with the included `shape_painter. py` program and see what the drawing looks like.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
Eva has many contacts on the professional networking site she uses which contacts are considered second degree
Answers: 3
question
Computers and Technology, 23.06.2019 15:00
Barbara is interested in pursuing a career in the science and math pathway. which qualifications will her reach that goal? a.an advanced knowledge of physics and math b.an advanced knowledge of engineering and math c. an advanced knowledge of physics and robotics an d. advanced knowledge of machinery and math
Answers: 2
question
Computers and Technology, 24.06.2019 02:20
The first time a user launches the powerpoint program, which view is shown allowing the user to access recent presentations or create new presentations based on templates?
Answers: 1
question
Computers and Technology, 25.06.2019 08:20
The main circuit board inside the system uit is called megaboard / true or false
Answers: 1
You know the right answer?
You will write a program that generates random drawings that can be drawn using the shape painter.
Questions
question
Mathematics, 02.07.2019 18:40