-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaba2_2
31 lines (28 loc) · 1.21 KB
/
laba2_2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import turtle as t
import mat as m
t.penup()
t.goto(-200,0)
t.pendown()
zero = [(50,0,0),(100,90,0),(50,90,0),(100,90,0),(0,90,0)]
one = [(50,90,1),(50*m.sqrt(2),225,0),(100,135,0),(50,90,1),(100,90,1),(0,90,0)]
two = [(50,0,0),(50,90,0),(50*m.sqrt(2),45,0),(50,225,0),(100,270,1),(50,270,1),(0,180,0)]
three = [(50,0,0),(50*m.sqrt(2),135,0),(50,225,0),(50*m.sqrt(2),135,0),(100,135,1),(0,90,0)]
four = [(50,90,0),(50,270,0),(50,90,0),(100,180,0),(50,270,1),(0,180,0)]
five = [(50,0,0),(50,180,1),(50,270,0),(50,270,0),(50,90,0),(50,90,0),(100,90,1),(0,90,0)]
six = [(50,0,1),(50*m.sqrt(2),135,0),(50,225,0),(50,90,0),(50,90,0),(50,90,0),(50,0,1),(0,90,0)]
seven = [(50,0,0),(50,135,0),(50,315,0),(100,180,1),(0,90,0)]
eight = [(50,0,0),(50,90,0),(50,90,0),(50,90,0),(50,90,0),(100,90,0),(50,90,0),(100,90,0),(0,90,0)]
nine = [(50,0,0),(50,90,0),(50,90,0),(50,90,0),(50,90,0),(50,90,0),(50*m.sqrt(2),45,0),(100,135,1),(0,90,0)]
#A = input()
A = 141700
for i in range(len(A) :
if A[i]=='0'
t.penup()
t.goto(i*100+40-200,0)
t.pendown()
for j in range(len(zero)):
if zero[j][2] == 1:
t.penup()
else: t.pendown()
t.right(zero[j][1])
t.forward(zero[j][0])