Drawing a Circle
What would the
Babylonians have given thousands of years ago to have access to the function
circle(diameter)... right?
One of the benefits of modern programming languages is quick access to basic elements, "
without reinventing the wheel":
EXERCISE
Try to create a figure similar to the one below:
Draw as many circles as you want, in different colors!
Pen Thickness
Another useful function is
pensize(pixels)
,
which allows us to set the thickness of the drawn line.
For
example, test in the code:
t.pensize(5)
SMALL PROJECT
Create a program that reads the dimensions of a rectangle and the desired color from the user via the keyboard, then draws it graphically.
Try to solve the proposed exercises,
then proceed to the next page.