At My Fingertips
Compose a graphic of an orange, lemon, and lime.
The inside of a sliced citrus fruit is composed of a ring of circular sectors.
Implement the citrus_sector
function.
Use circular_sector to create the sector
and use rotate to rotate it so it is centered along the x-axis.
Create a function circle
that produces a circle.
Use ellipse.
Create a function composes
that takes a list of graphics and composes them into a single graphic.
Use repetition, starting with an empty_graphic and combining graphics with compose.
Create a function ring
that produces a ring of count
graphics, evenly spread across the 360 degrees of a circle.
The inside diameter of the ring should correspond to diameter
(the citrus segments should form a ring just outside the diameter).
Hint: If you need help, check out the Sliced Pitaya activity.
Implement a function sliced_citrus
that composes a sliced citrus from:
Use your composes
function.
Let's create convenience functions to create a sliced orange, lemon, or lime.
The functions call sliced_citrus
with the predefined colors of the corresponding citrus fruit.
Now compose an arrangement of citrus fruit, including at least one orange, one lemon, and one lime.
This activity has been created by LuCE Research Lab and is licensed under CC BY-SA 4.0.
Sliced Citrus
PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI
Privacy Policy • Platform Version b744b47 (Tue, 08 Oct 2024 16:30:14 GMT)