Files
project_drawing/drawing.py
jwberent eb1da33456 I changed my README.md file.
- There is nothing to reflect on as I have not added anything.
2025-09-26 19:33:15 -04:00

99 lines
1.5 KiB
Python

# drawing.py
# ----------
# By James Berent
#
# (This will make a person and the person will wave)
from turtle import *
def fly(forw):
penup()
forward(forw)
pendown()
def rectangle(height,width,col):
dimensions = [width, height, width, height]
fillcolor(col)
begin_fill()
for dim in dimensions:
forward(dim)
left(90)
end_fill()
def triangle_facing_right(height,col):
top_of_tri = (height**2+height**2)**(1/2)
color(col)
forward(height)
left(180)
fly(height)
right(90)
forward(height)
right(135)
forward(top_of_tri)
right(135)
fly(height)
left(180)
def triangle_facing_left(height,col):
top_of_tri = (height**2+height**2)**(1/2)
color(col)
forward(height)
left(90)
forward(height)
left(135)
forward(top_of_tri)
left(135)
def circ(radius):
circle(radius,360) #found in section 1 link of Typeface Problem set instructions
rectangle(250,150,"red") #this is the torso
right(90)
fly(150)
left(90)
rectangle(150,50,"blue") #this is the left leg
fly(100)
rectangle(150,50,"blue") #this is the right leg
fly(50)
left(90)
fly(350)
right(180)
rectangle(150,50,"red") #this is right arm
right(90)
fly(300)
left(90)
rectangle(150,50,"red") #this is left arm
right(180)
fly(50)
right(90)
fly(230)
left(90)
rectangle(10,30,"white") #this is the neck
left(90)
fly(5)
right(90)
fly(30)
right(90)
circ(35) #this is the head
left(90)
fly(50)
left(90)
fly(10)
right(180)
circ(5)
fly(25)
circ(5)
input()