generated from mwc/problemset_typeface
The letters A, D, L, and P were adjusted so all the lines fit inside the 8x8 grid. The code for letter A had to be changed in order for the middle crossbar to be perfectly centered and the diagnols of D nearly fit within the square.
My last work session today was working on the typeface problems. At first I felt confused because I was trying to figure out what my objective is. It looked intimidating but as I kept reading it the task became more visible as to what I need to do. Upon completing the assignment I tried to design and implement the first four letters of the alphabet but I came across a few comlications. When designing the letter A the middle crossbar was not being drawn in the correct spot, I sttruggled at first trying to figure out what to change but then figured out I had to change one wording of code to get the letter A to display properly. I felt relieved that I was able to solve my issue and after when trying to design the letter B I messed up my code somewhere to where my letter B turned out to be the letter P so at the end I was fortunate that I was able to accidently create a different letter which I was happy to end up using. Looking, at the list of command and looking up different commands of code online helped a lot when designing my chosen letters.
This commit is contained in:
55
typeface.py
55
typeface.py
@@ -13,7 +13,18 @@ from turtle import *
|
||||
from math import sqrt
|
||||
|
||||
def draw_letter_a(unit):
|
||||
pass
|
||||
pendown()
|
||||
left(75)
|
||||
forward(unit * 8)
|
||||
right(150)
|
||||
forward(unit * 8)
|
||||
backward(unit * 4)
|
||||
left(75)
|
||||
backward(unit * 2)
|
||||
penup()
|
||||
setheading(0)
|
||||
goto(pos()[0] + unit * 8, pos()[1])
|
||||
|
||||
|
||||
def draw_letter_b(unit):
|
||||
pass
|
||||
@@ -22,7 +33,22 @@ def draw_letter_c(unit):
|
||||
pass
|
||||
|
||||
def draw_letter_d(unit):
|
||||
pass
|
||||
pendown()
|
||||
left(90)
|
||||
forward(unit * 2)
|
||||
right(90)
|
||||
forward(unit)
|
||||
right(45)
|
||||
forward(unit / sqrt(2))
|
||||
right(45)
|
||||
forward(unit)
|
||||
right(45)
|
||||
forward(unit / sqrt(2))
|
||||
right(45)
|
||||
forward(unit)
|
||||
penup()
|
||||
setheading(0)
|
||||
forward(unit * 2)
|
||||
|
||||
def draw_letter_e(unit):
|
||||
pass
|
||||
@@ -46,7 +72,12 @@ def draw_letter_k(unit):
|
||||
pass
|
||||
|
||||
def draw_letter_l(unit):
|
||||
pass
|
||||
left(90)
|
||||
forward(unit * 8)
|
||||
backward(unit * 8)
|
||||
right(90)
|
||||
forward(unit * 6)
|
||||
backward(unit * 6)
|
||||
|
||||
def draw_letter_m(unit):
|
||||
pass
|
||||
@@ -58,7 +89,23 @@ def draw_letter_o(unit):
|
||||
pass
|
||||
|
||||
def draw_letter_p(unit):
|
||||
pass
|
||||
pendown()
|
||||
left(90)
|
||||
forward(unit * 8)
|
||||
right(90)
|
||||
forward(unit * 5)
|
||||
right(90)
|
||||
forward(unit * 4)
|
||||
right(90)
|
||||
forward(unit * 5)
|
||||
backward(unit * 5)
|
||||
right(90)
|
||||
forward(unit * 4)
|
||||
left(90)
|
||||
forward(unit * 5)
|
||||
penup()
|
||||
setheading(0)
|
||||
goto(pos()[0] + unit * 8, pos()[1])
|
||||
|
||||
def draw_letter_q(unit):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user