diff --git a/README.md b/README.md index aee1fea..7bf87f1 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,10 @@ which allows basic formatting. (Describe your goal for this project. If you want to link to an image, move the image to this directory, and then use the following syntax: -![Description](filename.png) +![My goal for this project is to recreate this cool geometric pattern.](image.jpeg) ) ## Planning -(Include your planning here, including your project milestone.) +Halfway finished for me would be being able to create one of the squares in the pattern. diff --git a/drawing.py b/drawing.py index 29fc89e..421e161 100644 --- a/drawing.py +++ b/drawing.py @@ -1,7 +1,86 @@ # drawing.py # ---------- -# By ____(you)___________ +# By Kayden # # (Briefly describe what this program does.) from turtle import * +from math import sqrt + +def fly(distance): + "The turtle moves without drawing for a specified distance." + penup() + forward(distance) + pendown() + +def square(size): + "This function defines the drawing of a square with an iteration." + for i in range(4): + forward(size) + right(90) + +def pattern(): + "The function draws a square in a square 3 times." + left(45) + square(50) + fly(5) + right(90) + fly(5) + left(90) + square(40) + fly(5) + right(90) + fly(5) + left(90) + square(30) + +def rotateright(): + "The turtle draws the pattern then moves and rotates right." + pattern() + left(135) + fly(15) + right(90) + fly(70) + right(90) + +def rotateleft(): + "The turtle draws the pattern then moves and rotates left." + pattern() + right(45) + fly(55) + left(90) + fly(70) + left(90) + fly(71) + left(180) + +def drawright(): + "The turtle draws squares to the right." + for i in range(5): + pattern() + left(135) + fly(85) + right(180) + +def drawleft(): + "The turtle draws squares to the left." + for i in range(5): + pattern() + right(45) + fly(57) + +def draw(): + drawright() + rotateright() + drawleft() + rotateleft() + +"The turtle starts at a specific point and facing a specific direction." +penup() +goto(-180,180) +pendown() +left(180) +for i in range(3): + draw() + +input() \ No newline at end of file diff --git a/image.jpeg b/image.jpeg new file mode 100644 index 0000000..977627c Binary files /dev/null and b/image.jpeg differ