generated from mwc/problemset_typeface
I did P K and S
This commit is contained in:
18
poetry.lock
generated
Normal file
18
poetry.lock
generated
Normal file
@@ -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"
|
||||
142
typeface.py
142
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
|
||||
|
||||
Reference in New Issue
Block a user