From 6a174f9dd73962ce72f81de61c54d2ef515bb7ab Mon Sep 17 00:00:00 2001 From: caglazir Date: Fri, 5 Sep 2025 22:14:09 -0400 Subject: [PATCH] I modified the code to draw a green heart with a pink arrow going through it. This process included tasks such as roation, color changes and using the penup/pendown commands. At first I felt a bit frustrated because I couldm't really figure out the UI, since I used Python only in Jupyter Notebook before. I also felt confused when I was trying to figure out the initial oritentation of the "pen". Once I figured that out, it was smooth sailing. It felt funny to need geometry after a long time not needing it. Once I was done, I felt happy! --- drawing.py | 41 +++++++++++++++++++++++++++++++++++------ poetry.lock | 7 +++++++ 2 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 poetry.lock diff --git a/drawing.py b/drawing.py index f3ee2e9..62a1689 100644 --- a/drawing.py +++ b/drawing.py @@ -1,3 +1,4 @@ +import math from turtle import ( forward, back, @@ -8,15 +9,43 @@ from turtle import ( color, ) +color("PaleGreen") +right(315) +forward(300) +left(45) forward(100) -right(360 * 2 / 5) +left(45) forward(100) -right(360 * 2 / 5) +left(45) forward(100) -right(360 * 2 / 5) +left(45) forward(100) -right(360 * 2 / 5) +right(90) forward(100) -right(360 * 2 / 5) - +left(45) +forward(100) +left(45) +forward(100) +left(45) +forward(100) +left(45) +forward(300) +left(45) +forward(60) +penup() +back(300/(math.sqrt(2))) +color("DeepPink") +pendown() +right(135) +back(600) +right(90) +forward(5) +right(135) +forward(5*(math.sqrt(2))) +right(90) +forward(5*(math.sqrt(2))) +right(135) +forward(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"