From b6457dc13a146a1f420c50be0fb6db77736aa5fa Mon Sep 17 00:00:00 2001 From: kdang Date: Thu, 25 Sep 2025 09:50:31 -0400 Subject: [PATCH] I was able to make the code write the letters abcd --- typeface.py | 111 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 103 insertions(+), 8 deletions(-) diff --git a/typeface.py b/typeface.py index 71d09a9..c561617 100644 --- a/typeface.py +++ b/typeface.py @@ -13,22 +13,117 @@ from turtle import * from math import sqrt def draw_letter_a(unit): - left(65) - forward(250) - right(125) - forward(250) + penup() + forward(unit * 2) + left(90) + pendown() + forward(unit * 6) + right(45) + forward(unit * 2 * sqrt(2)) + right(90) + forward(unit * 2 * sqrt(2)) + right(45) + forward(unit * 6) + right(180) + penup() + forward(unit * 4) + left(90) + pendown() + forward(unit * 4) + left(45) + penup() + forward(unit * 2 * sqrt(2)) + left(45) + forward(unit * 2) + left(90) + pendown() def draw_letter_b(unit): - pass + penup() + forward(unit * 2) + left(90) + pendown() + forward(unit * 8) + right(90) + forward(unit * 2) + right(45) + forward(unit * 2 * sqrt(2)) + right(90) + forward(unit * 2 * sqrt(2)) + left(90) + forward(unit * 2 * sqrt(2)) + right(90) + forward(unit * 2 * sqrt(2)) + right(45) + forward(unit * 2) + right(90) + penup() + forward(unit * 4) + right(90) + pendown() + forward(unit * 2) + right(135) + penup() + forward(unit * 4 * sqrt(2)) + left(135) + pendown() def draw_letter_c(unit): - pass + penup() + forward(unit * 2) + left(90) + forward(unit * 2) + pendown() + forward(unit * 4) + right(45) + forward(unit * 2 * sqrt(2)) + right(45) + forward(unit * 2) + right(90) + penup() + forward(unit * 8) + right(90) + pendown() + forward(unit * 2) + right(45) + forward(unit * 2 * sqrt(2)) + left(90) + penup() + forward(unit * 2 * sqrt(2)) + left(135) def draw_letter_d(unit): - pass + penup() + forward(unit * 2) + left(90) + pendown() + forward(unit * 8) + right(90) + forward(unit * 2) + right(45) + forward(unit * 2 * sqrt(2)) + right(45) + forward(unit * 4) + right(45) + forward(unit * 2 * sqrt(2)) + right(45) + forward(unit * 2) + penup() + forward(unit * 2) + left(180) def draw_letter_e(unit): - pass + penup() + forward(unit * 2) + left(90) + pendown() + forward(unit * 8) + right(90) + forward(unit * 4) + right(135) + penup() + forward(unit * 4 * sqrt(2)) + left(135) def draw_letter_f(unit): pass