From 2a662502222dbe21ce4754f18fd22e0a1a083e6f Mon Sep 17 00:00:00 2001 From: Pat Wick Date: Tue, 18 Jul 2023 21:47:53 -0400 Subject: [PATCH] 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?" --- typeface.py | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/typeface.py b/typeface.py index 7c92b94..862a2f4 100644 --- a/typeface.py +++ b/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)