Write a function doGraphics that will take a list as input. The function doGraphics will start by

Question:

Write a function doGraphics that will take a list as input. The function doGraphics will start by creating a canvas from the 640x480.jpg file in the mediasources folder.You will draw on the canvas according to the commands in the input list. Each element of the list will be a string. There will be two kinds of strings in the list:

• “b 200 120” means to draw a black dot at x position 200 and y position 120–(200,120). The numbers, of course, will change, but the command will always be a “b.” You can assume that the input numbers will always have three digits.

• “l 000 010 100 200” means to draw a line from position (0, 10) to position (100,200).

So an input list might look like: ["b 100 200","b 101 200","b 102 200","l 102 200 102 300"] (but have any number of elements).

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: