From 867e2ac63c0a44f6598b583678bf7ea8da71ca38 Mon Sep 17 00:00:00 2001 From: bpot Date: Tue, 3 Mar 2026 11:07:29 -0500 Subject: [PATCH] I did P K and S --- .envrc | 1 + poetry.lock | 18 +++++++ typeface.py | 142 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 158 insertions(+), 3 deletions(-) create mode 100644 .envrc create mode 100644 poetry.lock diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..4a96c22 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +source .venv/bin/activate \ No newline at end of file diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..6e37ab5 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,18 @@ +# This file is automatically @generated by Poetry 2.3.1 and should not be changed by hand. + +[[package]] +name = "superturtle" +version = "0.2.0" +description = "Extensions to Python's turtle" +optional = false +python-versions = "<4.0,>=3.9" +groups = ["main"] +files = [ + {file = "superturtle-0.2.0-py3-none-any.whl", hash = "sha256:ca3a31be3259387b4490846adbf64502acc9d23472912cc43497ab170e89f506"}, + {file = "superturtle-0.2.0.tar.gz", hash = "sha256:807fb419c1dba9cb809a22a68e72c0193bdeed4a9326eb36ad940b2a7ff6ac04"}, +] + +[metadata] +lock-version = "2.1" +python-versions = ">=3.10,<4.0" +content-hash = "6aad436bbbf760fa856344262eab22d62a167cac4e5dfefbf4be77d5a37428c9" diff --git a/typeface.py b/typeface.py index b966bef..8061272 100644 --- a/typeface.py +++ b/typeface.py @@ -12,6 +12,7 @@ from turtle import * from math import sqrt + def draw_letter_a(unit): pass @@ -43,7 +44,38 @@ def draw_letter_j(unit): pass def draw_letter_k(unit): - pass + + diagonal_45 = sqrt((unit*unit)+(unit*unit)) + + penup() + forward(unit*2) + left(90) + pendown() + forward(unit*8) + right(90) + forward(unit) + right(90) + forward(unit*3) + left(135) + forward(diagonal_45*3) + right(45) + forward(unit) + right(135) + forward(diagonal_45*4) + left(90) + forward(diagonal_45*4) + right(135) + forward(unit) + right(45) + forward(diagonal_45*3) + left(135) + forward(unit*3) + right(90) + forward(unit) + penup() + forward(unit*2) + right(180) + pendown() def draw_letter_l(unit): pass @@ -58,7 +90,69 @@ def draw_letter_o(unit): pass def draw_letter_p(unit): - pass + + diagonal_26 = (unit * sqrt(5/4)) + diagonal_45 = sqrt((unit*unit)+(unit*unit)) + + def corner_left(): + left(26.565) + forward(diagonal_26) + left(45-26.565) + forward(diagonal_45/2) + left(45-26.565) + forward(diagonal_26) + + penup() + forward(unit*3) + pendown() + forward(unit) + left(90) + forward(unit*3) + right(90) + forward(unit) + corner_left() + left(26.565) + forward(unit) + corner_left() + left(26.565) + forward(unit*2) + left(90) + forward(unit*8) + + penup() + #placing the interior hole + left(90) + #how far to the right do you want the interior hole of the P? + forward(unit*1.5) + left(90) + #how far up do we want the interior hole? + forward(unit*4.5) + + pendown() + #Draw the interior hole + forward(unit*2) + right(90) + forward(unit*1) + right(45) + forward(diagonal_45/2) + right(45) + forward(unit) + right(45) + forward(diagonal_45/2) + right(45) + forward(unit*1) + penup() + forward(unit*4.5) + left(90) + forward(unit*4.5) + left(90) + pendown() + + + + + + def draw_letter_q(unit): pass @@ -67,7 +161,49 @@ def draw_letter_r(unit): pass def draw_letter_s(unit): - pass + + diagonal_26 = (unit * sqrt(5/4)) + diagonal_45 = sqrt((unit*unit)+(unit*unit)) + + def corner_left(): + left(26.565) + forward(diagonal_26) + left(45-26.565) + forward(diagonal_45/2) + left(45-26.565) + forward(diagonal_26) + + def corner_right(): + right(26.565) + forward(diagonal_26) + right(45-26.565) + forward(diagonal_45/2) + right(45-26.565) + forward(diagonal_26) + + def s_side(): + corner_left() + left(26.565) + corner_left() + left(26.565) + corner_right() + right(26.565) + corner_right() + right(26.565) + + penup() + forward(unit*3) + pendown() + s_side() + forward(unit) + right(180) + s_side() + forward(unit) + penup() + forward(unit*3) + right(180) + pendown() + def draw_letter_t(unit): pass