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 19:30
When using a public computer or network, you should always
Answers: 2
question
Computers and Technology, 23.06.2019 09:20
How to print: number is equal to: 1 and it is odd number number is equal to: 2 and it is even number number is equal to: 3 and it is odd number number is equal to: 4 and it is even number in the console using java using 1 if statement, 1 while loop, 1 else loop also using % to check odds and evens
Answers: 3
question
Computers and Technology, 23.06.2019 18:40
How does is make you feel when you're kind to others? what are some opportunities in your life to be more kind to your friends and loved ones? imagine a world where kindness has be outlawed. how would people act differently? would your day-to-day life change significantly? why or why not?
Answers: 2
question
Computers and Technology, 24.06.2019 00:00
Visualizing a game of “tag” to remember the meaning of contagious
Answers: 3
You know the right answer?
You will write a program that generates random drawings that can be drawn using the shape painter.
Questions
Questions on the website: 13722360