generated from mwc/problemset_typeface
Added 'C', fixed 'D' shift from turtle position
First I realized the grid was offset one block for every letter after the D on the proof so I modified the turtle's final position to correctly be the lower-left corner. I mapped the 'C' and was proud at how smoothly it worked on the test.py run until I ran proof.py and the whole thing went crazy. Turns out while I had noted all of the segment lengths and angles for the turns, I can't tell right from left and ended up shifting 135 degrees in the wrong direction, which explained the crazy. If I was feeling anything there, it would be the embodiment of "oh no, what now?"
This commit is contained in:
parent
f9ae5bcd95
commit
2a66250222
36
typeface.py
36
typeface.py
|
@ -34,10 +34,38 @@ def draw_letter_b(unit):
|
|||
pass
|
||||
|
||||
def draw_letter_c(unit):
|
||||
pass
|
||||
no_pen(3,unit)
|
||||
|
||||
segment(4,unit)
|
||||
left(90)
|
||||
segment(2,unit)
|
||||
left(90)
|
||||
segment(2,unit)
|
||||
right(45)
|
||||
diagonal(2,unit)
|
||||
right(90)
|
||||
diagonal(2,unit)
|
||||
right(45)
|
||||
segment(2,unit)
|
||||
left(90)
|
||||
segment(2,unit)
|
||||
left(90)
|
||||
segment(4,unit)
|
||||
left(45)
|
||||
diagonal(2,unit)
|
||||
left(45)
|
||||
segment(4,unit)
|
||||
left(45)
|
||||
diagonal(2,unit)
|
||||
|
||||
right(135)
|
||||
no_pen(3,unit)
|
||||
left(180)
|
||||
|
||||
def draw_letter_d(unit):
|
||||
no_pen(1,unit)
|
||||
|
||||
# the outline of the D
|
||||
segment(5,unit)
|
||||
left(45)
|
||||
diagonal(1,unit)
|
||||
|
@ -49,10 +77,13 @@ def draw_letter_d(unit):
|
|||
segment(5,unit)
|
||||
left(90)
|
||||
segment(8,unit)
|
||||
|
||||
left(90)
|
||||
no_pen(2,unit)
|
||||
left(90)
|
||||
no_pen(2,unit)
|
||||
|
||||
# the inner part of the D
|
||||
segment(4,unit)
|
||||
right(90)
|
||||
segment(1,unit)
|
||||
|
@ -64,7 +95,8 @@ def draw_letter_d(unit):
|
|||
diagonal(1,unit)
|
||||
right(45)
|
||||
segment(1,unit)
|
||||
no_pen(2,unit)
|
||||
|
||||
no_pen(3,unit)
|
||||
left(90)
|
||||
no_pen(2,unit)
|
||||
left(90)
|
||||
|
|
Loading…
Reference in New Issue