generated from mwc/problemset_typeface
typeface.py
This commit is contained in:
37
typeface.py
37
typeface.py
@@ -1,6 +1,8 @@
|
||||
# typeface.py
|
||||
# By Chris Proctor and Nelson Mason
|
||||
# Due by 9-29-2025
|
||||
# First update 9-25-2025
|
||||
# Second update 9-26-2025
|
||||
|
||||
# Contains one function for each letter in the English alphabet.
|
||||
# Each function should draw its letter at a scale of `unit`, and then
|
||||
@@ -48,7 +50,7 @@ def draw_letter_j(unit):
|
||||
forward(unit*1.5)
|
||||
pendown()
|
||||
pensize(10)
|
||||
color(1, 1, 0)
|
||||
color(1, 1, 0) # yellow
|
||||
forward(unit*5)
|
||||
penup()
|
||||
right(180)
|
||||
@@ -90,24 +92,19 @@ def draw_letter_o(unit):
|
||||
forward(unit*2.5)
|
||||
pendown()
|
||||
pensize(10)
|
||||
color(1, 0.647, 0)
|
||||
forward(unit*3)
|
||||
right(45)
|
||||
forward(unit*1.5*sqrt(2))
|
||||
right(45)
|
||||
forward(unit*5)
|
||||
right(45)
|
||||
forward(unit*1.5*sqrt(2))
|
||||
right(45)
|
||||
forward(unit*3)
|
||||
right(45)
|
||||
forward(unit*1.5*sqrt(2))
|
||||
right(45)
|
||||
forward(unit*5)
|
||||
right(45)
|
||||
forward(unit*1.5*sqrt(2))
|
||||
color(1, 0.647, 0) # orange
|
||||
for x in range(2): # iteration for identicle Turtle movements
|
||||
forward(unit*3)
|
||||
right(45)
|
||||
forward(unit*1.5*sqrt(2))
|
||||
right(45)
|
||||
forward(unit*5)
|
||||
right(45)
|
||||
forward(unit*1.5*sqrt(2))
|
||||
right(45)
|
||||
|
||||
penup()
|
||||
left(135)
|
||||
left(180)
|
||||
forward(unit*2.5)
|
||||
left(90)
|
||||
forward(unit*8)
|
||||
@@ -124,7 +121,7 @@ def draw_letter_q(unit):
|
||||
|
||||
def draw_letter_r(unit):
|
||||
pensize(10)
|
||||
color(1, 0, 0)
|
||||
color(1, 0, 0) # red
|
||||
left(90)
|
||||
forward(unit*8)
|
||||
right(90)
|
||||
@@ -179,7 +176,7 @@ def draw_letter_z(unit):
|
||||
right(90)
|
||||
pendown()
|
||||
pensize(10)
|
||||
color(0, 1, 1)
|
||||
color(0, 1, 1) # aqua blue
|
||||
forward(unit*8)
|
||||
right(135)
|
||||
forward(unit*8*sqrt(2))
|
||||
|
||||
Reference in New Issue
Block a user