From 4b0fbec36aef5b8ea26ab56956d508e0bf25fc11 Mon Sep 17 00:00:00 2001 From: kdang Date: Mon, 29 Sep 2025 09:49:01 -0400 Subject: [PATCH] I wrote code to draw the letters abcdefghijklmnop --- typeface.py | 267 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 254 insertions(+), 13 deletions(-) diff --git a/typeface.py b/typeface.py index c561617..b564824 100644 --- a/typeface.py +++ b/typeface.py @@ -124,42 +124,283 @@ def draw_letter_e(unit): penup() forward(unit * 4 * sqrt(2)) left(135) + pendown() + forward(unit * 4) + right(135) + penup() + forward(unit * 4 * sqrt(2)) + left(135) + pendown() + forward(unit * 4) + right(180) + penup() + forward(unit * 6) + right(180) + def draw_letter_f(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) + pendown() + forward(unit * 4) + right(135) + penup() + forward(unit * 4 * sqrt(2)) + left(315) + penup() + forward(unit * 2) + right(180) def draw_letter_g(unit): - pass + penup() + forward(unit * 2) + left(90) + pendown() + forward(unit * 8) + right(90) + forward(unit * 4) + right(90) + penup() + forward(unit * 4) + right(90) + pendown() + forward(unit * 2) + right(180) + penup() + forward(unit * 2) + right(90) + pendown() + forward(unit * 4) + right(90) + forward(unit * 4) + penup() + forward(unit * 2) + right(180) def draw_letter_h(unit): - pass + penup() + forward(unit * 2) + left(90) + pendown() + forward(unit * 8) + right(180) + penup() + forward(unit * 4) + left(90) + pendown() + forward(unit * 4) + left(90) + forward(unit * 4) + right(180) + penup() + forward(unit * 4) + pendown() + forward(unit * 4) + right(90) + penup() + forward(unit * 6) + right(180) + def draw_letter_i(unit): - pass - + penup() + forward(unit * 2) + pendown() + forward(unit * 4) + right(180) + penup() + forward(unit * 2) + right(90) + pendown() + forward(unit * 8) + right(90) + forward(unit * 2) + right(180) + penup() + forward(unit * 2) + pendown() + forward(unit * 2) + left(90) + penup() + forward(unit * 8) + right(90) + forward(unit * 2) + right(180) + def draw_letter_j(unit): - pass + penup() + forward(unit * 2) + pendown() + forward(unit * 2) + left(90) + forward(unit * 8) + right(90) + forward(unit * 2) + right(180) + penup() + forward(unit * 2) + pendown() + forward(unit * 2) + left(90) + penup() + forward(unit * 8) + right(90) + forward(unit * 2) + right(180) def draw_letter_k(unit): - pass + penup() + forward(unit * 2) + left(90) + pendown() + forward(unit * 8) + right(180) + penup() + forward(unit * 4) + left(135) + pendown() + forward(unit * 4 * sqrt(2)) + right(135) + penup() + forward(unit * 8) + pendown() + right(135) + forward(unit * 4 * sqrt(2)) + left(135) + penup() + forward(unit * 4) + right(90) + forward(unit * 2) + right(180) def draw_letter_l(unit): - pass + penup() + forward(unit * 2) + left(90) + pendown() + forward(unit * 8) + right(180) + penup() + forward(unit * 8) + left(90) + pendown() + forward(unit * 4) + left(180) + penup() + forward(unit * 6) + left(180) def draw_letter_m(unit): - pass + penup() + forward(unit * 2) + left(90) + pendown() + forward(unit * 8) + right(90) + forward(unit * 2) + right(90) + forward(unit * 8) + left(180) + penup() + forward(unit * 8) + right(90) + pendown() + forward(unit * 2) + right(90) + forward(unit * 8) + right(90) + penup() + forward(unit * 6) + right(180) def draw_letter_n(unit): - pass + penup() + forward(unit * 2) + left(90) + pendown() + forward(unit * 8) + right(90) + forward(unit * 4) + right(90) + forward(unit * 8) + right(90) + penup() + forward(unit * 6) + right(180) def draw_letter_o(unit): - pass + penup() + forward(unit * 2) + left(90) + pendown() + forward(unit * 8) + right(90) + forward(unit * 4) + right(90) + forward(unit * 8) + right(90) + forward(unit * 4) + penup() + forward(unit * 2) + right(180) def draw_letter_p(unit): - pass + penup() + forward(unit * 2) + left(90) + pendown() + forward(unit * 8) + right(90) + forward(unit * 4) + right(90) + forward(unit * 4) + right(90) + forward(unit * 4) + left(90) + penup() + forward(unit * 4) + right(90) + forward(unit * 2) + right(180) def draw_letter_q(unit): - pass + penup() + forward(unit * 2) + left(90) + forward(unit) + pendown() + forward(unit * 7) + right(90) + forward(unit * 4) + right(90) + forward(unit * 7) + penup() + forward(unit) + right(135) + pendown() + forward(unit * 2) + left(135) + penup() + forward(unit * sqrt(2)) + left(90) + forward(unit) + pendown() + forward(unit * 3) + left(90) + penup() + forward(unit) + right(90) + forward(unit * 2) + right(180) def draw_letter_r(unit): pass