Files
lab_turtle/drawing.py
sigrid 4c1c6c8fa8 First experiment with turtle.
I tried playing around with turtle for the first time. I got the hang of it pretty quickly! First I got stopped by the extra functions, cause I didnt realise I should have added them to the list. Once I figured that out I could quickly replicate the code of the star and duplicate it at different angles around the screen. It was a very satisfying experience and I want to experiment more!
2025-08-28 15:36:16 +08:00

105 lines
1.4 KiB
Python

from turtle import (
forward,
back,
left,
right,
penup,
pendown,
color,
pensize,
speed,
setheading,
circle,
goto,
begin_fill,
end_fill,
fillcolor,
)
pensize(2)
color('red')
forward(100)
right(360 * 2 / 5)
color('chocolate')
forward(100)
right(360 * 2 / 5)
color('gold')
forward(100)
right(360 * 2 / 5)
color('yellow green')
forward(100)
right(360 * 2 / 5)
color('steel blue')
forward(100)
right(360 * 2 / 5)
penup()
back(250)
right(90)
forward(100)
right(360 * 2 / 5)
pendown()
color('red')
forward(100)
right(360 * 2 / 5)
color('chocolate')
forward(100)
right(360 * 2 / 5)
color('gold')
forward(100)
right(360 * 2 / 5)
color('yellow green')
forward(100)
right(360 * 2 / 5)
color('steel blue')
forward(100)
right(360 * 2 / 5)
penup()
right(180)
forward(200)
right(360 * 2 / 5)
pendown()
color('red')
forward(100)
right(360 * 2 / 5)
color('chocolate')
forward(100)
right(360 * 2 / 5)
color('gold')
forward(100)
right(360 * 2 / 5)
color('yellow green')
forward(100)
right(360 * 2 / 5)
color('steel blue')
forward(100)
right(360 * 2 / 5)
penup()
goto(100,100)
forward(100)
pendown()
color('red')
forward(100)
right(360 * 2 / 5)
color('chocolate')
forward(100)
right(360 * 2 / 5)
color('gold')
forward(100)
right(360 * 2 / 5)
color('yellow green')
forward(100)
right(360 * 2 / 5)
color('steel blue')
forward(100)
right(360 * 2 / 5)
input()