From 4bd89e6e80b27c745d2de4b04710b9d77364c281 Mon Sep 17 00:00:00 2001 From: Heather Date: Thu, 9 Oct 2025 20:37:36 -0400 Subject: [PATCH] This is my 1st commit for the drawing prject. I've only written a little bit so far, but I can not get the code to run. I am not sure why. It is not running for 2 of my letters in the problem set lab eaither. I am meeting with Emma monday mornign to hopefully get caught up --- drawing.py | 40 ++++++++++++++++++++++++++++++++++++++-- project_drawing | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 project_drawing diff --git a/drawing.py b/drawing.py index 29fc89e..2c315dd 100644 --- a/drawing.py +++ b/drawing.py @@ -1,7 +1,43 @@ # drawing.py # ---------- -# By ____(you)___________ +# By _Heather Maher_________ # -# (Briefly describe what this program does.) +# (This program creates an abstract pattern using complementary colors) +import turtle from turtle import * + +# Setup the screen +screen = turtle.Screen() +screen.bgcolor("black") + +# Create the turtle +t = turtle.Turtle() +t.speed(10) +t.width(3) + +# Complementary colors for the pattern +colors = [("red", "green"), ("blue", "orange"), ("yellow", "purple")] + +def square(size, color1, color2, side_length): + for _ in range(4): + t.color1 + forward(side_length) + right(90) + forward(side_length) + right(90) + forward(side_length) + right(90) + forward(side_length) + right(90) + +# Function to draw the abstract pattern +def draw_pattern(): + size = 100 + for i in range(20): + color1, color2 = colors[i % len(colors)] + draw_square(size, color1, color2) + t.left(36) + size += 10 + +input() diff --git a/project_drawing b/project_drawing new file mode 100644 index 0000000..50479f3 --- /dev/null +++ b/project_drawing @@ -0,0 +1,43 @@ +# drawing.py +# ---------- +# By _Heather Maher_________ +# +# (This program creates an abstract pattern using complementary colors) + +import turtle +from turtle import * + +# Setup the screen +screen = turtle.Screen() +screen.bgcolor("black") + +# Create the turtle +t = turtle.Turtle() +t.speed(10) +t.width(3) + +# Complementary colors for the pattern +colors = [("red", "green"), ("blue", "orange"), ("yellow", "purple")] + +def square(size, color1, color2, side_length): + for _ in range(4): + t.color1 + forward(side_length) + right(90) + forward(side_length) + right(90) + forward(side_length) + right(90) + forward(side_length) + right(90) + +# Function to draw the abstract pattern +def draw_pattern(): + size = 100 + for i in range(20): + color1, color2 = colors[i % len(colors)] + draw_square(size, color1, color2) + t.left(36) + size += 10 + +input() \ No newline at end of file