-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNumberLCD.py
75 lines (72 loc) · 3.76 KB
/
NumberLCD.py
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
class NumberLCD():
def __init__(self, number):
self.number = int(number)
self.lineOne = None
self.lineTwo = None
self.lineTree = None
self.lineFour = None
self.lineFive = None
self.evaluateNumber()
def evaluateNumber(self):
if self.number == 1:
self.lineOne = [False, False, False, False, False]
self.lineTwo = [False, False, True, False, False]
self.lineTree = [False, False, False, False, False]
self.lineFour = [False, False, True, False, False]
self.lineFive = [False, False, False, False, False]
elif self.number == 2:
self.lineOne = [False, True, False, False, False]
self.lineTwo = [False, False, True, False, False]
self.lineTree = [False, True, False, False, False]
self.lineFour = [True, False, False, False, False]
self.lineFive = [False, True, False, False, False]
elif self.number == 3:
self.lineOne = [False, True, False, False, False]
self.lineTwo = [False, False, True, False, False]
self.lineTree = [False, True, False, False, False]
self.lineFour = [False, False, True, False, False]
self.lineFive = [False, True, False, False, False]
elif self.number == 4:
self.lineOne = [False, False, False, False, False]
self.lineTwo = [True, False, True, False, False]
self.lineTree = [False, True, False, False, False]
self.lineFour = [False, False, True, False, False]
self.lineFive = [False, False, False, False, False]
elif self.number == 5:
self.lineOne = [False, True, False, False, False]
self.lineTwo = [True, False, False, False, False]
self.lineTree = [False, True, False, False,False]
self.lineFour = [False, False, True, False, False]
self.lineFive = [False, True, False, False, False]
elif self.number == 6:
self.lineOne = [False, True, False, False, False]
self.lineTwo = [True, False, False, False, False]
self.lineTree = [True, True, False, False, False]
self.lineFour = [True, False, True, False, False]
self.lineFive = [False, True, False, False,False]
elif self.number == 7:
self.lineOne = [False, True, False, False, False]
self.lineTwo = [False, False, True, False, False]
self.lineTree = [False, False, False, False, False]
self.lineFour = [False, False, True, False, False]
self.lineFive = [False, False, False, False, False]
elif self.number == 8:
self.lineOne = [False, True, False, False, False]
self.lineTwo = [True, False, True, False, False]
self.lineTree = [False, True, False, False, False]
self.lineFour = [True, False, True, False, False]
self.lineFive = [False, True, False, False, False]
elif self.number == 9:
self.lineOne = [False, True, False, False,False]
self.lineTwo = [True, True, True, False, False]
self.lineTree = [False, True, True, False, False]
self.lineFour = [False, False, True, False, False]
self.lineFive = [False, True, False, False, False]
elif self.number == 0:
self.lineOne = [False, True, False, False, False]
self.lineTwo = [True, False, True, False, False]
self.lineTree = [False, False, False, False, False]
self.lineFour = [True, False, True, False, False]
self.lineFive = [False, True, False, False, False]
def returnLines(self):
return self.lineOne, self.lineTwo, self.lineTree, self.lineFour, self.lineFive