From 4c1c6c8fa864057342a9780595e16f88069a94a0 Mon Sep 17 00:00:00 2001 From: sigrid Date: Thu, 28 Aug 2025 15:36:16 +0800 Subject: [PATCH] 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! --- drawing.py | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++ poetry.lock | 7 +++++ 2 files changed, 89 insertions(+) create mode 100644 poetry.lock diff --git a/drawing.py b/drawing.py index f3ee2e9..307b5f5 100644 --- a/drawing.py +++ b/drawing.py @@ -6,17 +6,99 @@ from turtle import ( 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() diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..7e72dc6 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Poetry 2.1.4 and should not be changed by hand. +package = [] + +[metadata] +lock-version = "2.1" +python-versions = ">=3.10,<4.0" +content-hash = "7b8fc01b274bd807fb00372bbc8e138330f15ae7978ed61e180f3b17ec076725"