-
Notifications
You must be signed in to change notification settings - Fork 1
/
Target.py
75 lines (71 loc) · 1.02 KB
/
Target.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
from enum import Enum, unique
@unique
class Shape(Enum):
circle = 0
semicircle = 1
quarter_circle = 2
triangle = 3
square = 4
rectangle = 5
trapezoid = 6
pentagon = 7
hexagon = 8
heptagon = 9
octagon = 10
star = 11
cross = 12
@unique
class Color(Enum):
red = 0
orange = 1
yellow = 2
green = 3
blue = 4
purple = 5
brown = 6
black = 7
gray = 8
white = 9
def alphanumeric_to_num(name):
if(ord(name)<65):
return ord(name) - 48
else:
return ord(name) - 55
def num_to_alphanumeric(num):
return {
0:'0',
1:'1',
2:'2',
3:'3',
4:'4',
5:'5',
6:'6',
7:'7',
8:'8',
9:'9',
10:'A',
11:'B',
12:'C',
13:'D',
14:'E',
15:'F',
16:'G',
17:'H',
18:'I',
19:'J',
20:'K',
21:'L',
22:'M',
23:'N',
24:'O',
25:'P',
26:'Q',
27:'R',
28:'S',
29:'T',
30:'U',
31:'V',
32:'W',
33:'X',
34:'Y',
35:'Z'}.get(num)