generated from mwc/problemset_typeface
	typeface.py
This commit is contained in:
		
							
								
								
									
										113
									
								
								typeface.py
									
									
									
									
									
								
							
							
						
						
									
										113
									
								
								typeface.py
									
									
									
									
									
								
							@@ -1,5 +1,6 @@
 | 
			
		||||
# typeface.py
 | 
			
		||||
# By Chris Proctor and _________
 | 
			
		||||
# By Chris Proctor and Nelson Mason
 | 
			
		||||
# Due by 9-29-2025
 | 
			
		||||
 | 
			
		||||
# Contains one function for each letter in the English alphabet. 
 | 
			
		||||
# Each function should draw its letter at a scale of `unit`, and then 
 | 
			
		||||
@@ -40,7 +41,34 @@ def draw_letter_i(unit):
 | 
			
		||||
    pass
 | 
			
		||||
 | 
			
		||||
def draw_letter_j(unit):
 | 
			
		||||
    pass
 | 
			
		||||
    penup()
 | 
			
		||||
    left(90)
 | 
			
		||||
    forward(unit*8)
 | 
			
		||||
    right(90)
 | 
			
		||||
    forward(unit*1.5)
 | 
			
		||||
    pendown()
 | 
			
		||||
    pensize(10)
 | 
			
		||||
    color(1, 1, 0)
 | 
			
		||||
    forward(unit*5)
 | 
			
		||||
    penup()
 | 
			
		||||
    right(180)
 | 
			
		||||
    forward(unit*2.5)
 | 
			
		||||
    left(90)
 | 
			
		||||
    pendown()
 | 
			
		||||
    forward(unit*7)
 | 
			
		||||
    right(45)
 | 
			
		||||
    forward(unit*sqrt(2))
 | 
			
		||||
    right(45)
 | 
			
		||||
    forward(unit)
 | 
			
		||||
    right(45)
 | 
			
		||||
    forward(unit*sqrt(2))
 | 
			
		||||
    penup()
 | 
			
		||||
    left(135)
 | 
			
		||||
    forward(unit)
 | 
			
		||||
    left(90)
 | 
			
		||||
    pendown()
 | 
			
		||||
    pensize(1)
 | 
			
		||||
    color(0, 0, 0)
 | 
			
		||||
 | 
			
		||||
def draw_letter_k(unit):
 | 
			
		||||
    pass
 | 
			
		||||
@@ -55,7 +83,38 @@ def draw_letter_n(unit):
 | 
			
		||||
    pass
 | 
			
		||||
 | 
			
		||||
def draw_letter_o(unit):
 | 
			
		||||
    pass
 | 
			
		||||
    penup()
 | 
			
		||||
    left(90)
 | 
			
		||||
    forward(unit*8)
 | 
			
		||||
    right(90)
 | 
			
		||||
    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))
 | 
			
		||||
    penup()
 | 
			
		||||
    left(135)
 | 
			
		||||
    forward(unit*2.5)
 | 
			
		||||
    left(90)
 | 
			
		||||
    forward(unit*8)
 | 
			
		||||
    left(90)
 | 
			
		||||
    pendown()
 | 
			
		||||
    pensize(1)
 | 
			
		||||
    color(0, 0, 0)
 | 
			
		||||
 | 
			
		||||
def draw_letter_p(unit):
 | 
			
		||||
    pass
 | 
			
		||||
@@ -64,7 +123,33 @@ def draw_letter_q(unit):
 | 
			
		||||
    pass
 | 
			
		||||
 | 
			
		||||
def draw_letter_r(unit):
 | 
			
		||||
    pass
 | 
			
		||||
    pensize(10)
 | 
			
		||||
    color(1, 0, 0)
 | 
			
		||||
    left(90)
 | 
			
		||||
    forward(unit*8)
 | 
			
		||||
    right(90)
 | 
			
		||||
    forward(unit*6)
 | 
			
		||||
    right(45)
 | 
			
		||||
    forward(unit*sqrt(2))
 | 
			
		||||
    right(45)
 | 
			
		||||
    forward(unit*2)
 | 
			
		||||
    right(45)
 | 
			
		||||
    forward(unit*sqrt(2))
 | 
			
		||||
    right(45)
 | 
			
		||||
    forward(unit*6)
 | 
			
		||||
    penup()
 | 
			
		||||
    right(180)
 | 
			
		||||
    forward(unit*5)
 | 
			
		||||
    pendown()
 | 
			
		||||
    right(63.43) # derived from an online SOH-CAH-TOA app
 | 
			
		||||
    forward(unit*sqrt((4**2)+(2**2)))
 | 
			
		||||
    penup()
 | 
			
		||||
    right(116.57) # derived from an online SOH-CAH-TOA app
 | 
			
		||||
    forward(unit*7)
 | 
			
		||||
    right(180)
 | 
			
		||||
    pendown()
 | 
			
		||||
    pensize(1)
 | 
			
		||||
    color(0, 0, 0)
 | 
			
		||||
 | 
			
		||||
def draw_letter_s(unit):
 | 
			
		||||
    pass
 | 
			
		||||
@@ -88,4 +173,22 @@ def draw_letter_y(unit):
 | 
			
		||||
    pass
 | 
			
		||||
 | 
			
		||||
def draw_letter_z(unit):
 | 
			
		||||
    pass
 | 
			
		||||
    penup()
 | 
			
		||||
    left(90)
 | 
			
		||||
    forward(unit*8)
 | 
			
		||||
    right(90)
 | 
			
		||||
    pendown()
 | 
			
		||||
    pensize(10)
 | 
			
		||||
    color(0, 1, 1)
 | 
			
		||||
    forward(unit*8)
 | 
			
		||||
    right(135)
 | 
			
		||||
    forward(unit*8*sqrt(2))
 | 
			
		||||
    left(135)
 | 
			
		||||
    forward(unit*8)
 | 
			
		||||
    penup()
 | 
			
		||||
    left(180)
 | 
			
		||||
    forward(unit*8)
 | 
			
		||||
    left(180)
 | 
			
		||||
    pendown()
 | 
			
		||||
    pensize(1)
 | 
			
		||||
    color(0, 0, 0)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user