-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfeatures.py
193 lines (184 loc) · 5.39 KB
/
features.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
""" features.py
This file defines a Trans America map
It does this by defining a set of rows and columns,
and then expressing where cities, mountains, and oceans
are. Everything else is presumed to be 'normal land'.
The map is built using some form of Offset coordinates,
although Jeremy has not yet puzzled out what kind.
The net effect seems to be that we consider 'down and left'
to really be down, and 'up and right' to really be up.
Coordinates are expressed using (row, col) annotation
"""
LAST_COLUMN = 20
LAST_ROW = 13
CITIES = {'green': {'Seatle': (0, 0),
'Portland': (1, 0),
'Medford': (3, 1),
'Sacramento': (5, 2),
'San Fransisco': (6, 2),
'Los Angeles': (9, 5),
'San Diego': (10, 6)},
'blue': {'Helena': (1, 3),
'Bismark': (1, 7),
'Duluth': (1, 10),
'Mineapolis': (2, 10),
'Buffalo': (2, 15),
'Chicago': (3, 13),
'Cincinati': (5, 15)},
'orange': {'Boston': (2, 17),
'New York City': (4, 17),
'Washington': (5, 17),
'Richmond': (7, 18),
'Winston': (8, 17),
'Jacksonville': (12, 19),
'Charleston': (10, 19)},
'yellow': {'Salt Lake City': (4, 4),
'Omaha': (4, 9),
'Denver': (5, 7),
'Kansas': (6, 11),
'St. Louis': (6, 13),
'Santa Fe': (8, 8),
'Oklahoma City': (8, 11)},
'red': {'Phoenix': (9, 7),
'El Paso': (11, 10),
'Memphis': (9, 15),
'Dallas': (10, 13),
'Atlanta': (10, 17),
'Houston': (12, 14),
'New Orleans': (12, 16)}}
MOUNTAINS_AND_RIVERS = [
((0, 0), (0, 1)),
#Rockies
((0, 0), (1, 1)),
((1, 0), (1, 1)),
((1, 0), (2, 1)),
((2, 0), (2, 1)),
((3, 1), (2, 1)),
((3, 1), (3, 2)),
((3, 1), (4, 2)),
((4, 1), (4, 2)),
((5, 2), (4, 2)),
((5, 2), (5, 3)),
((5, 2), (6, 3)),
((5, 3), (5, 4)),
((5, 3), (6, 4)),
((5, 3), (4, 3)),
((6, 3), (6, 4)),
((6, 3), (7, 3)),
((7, 3), (7, 4)),
((8, 4), (8, 5)),
((9, 5), (9, 6)),
#Colorado River
((4, 5), (5, 5)),
((5, 5), (6, 6)),
((6, 6), (5, 6)),
((6, 6), (6, 5)),
((6, 5), (7, 6)),
((7, 5), (7, 6)),
((7, 5), (8, 6)),
((8, 5), (8, 6)),
((9, 6), (8, 6)),
((8, 7), (8, 6)),
((9, 7), (9, 6)),
((10, 7), (9, 6)),
((10, 6), (10, 7)),
((9, 7), (8, 7)),
((9, 7), (9, 8)),
((9, 8), (10, 8)),
((9, 8), (10, 9)),
#Helena Mountains
((0, 2), (1, 2)),
((1, 2), (1, 3)),
((1, 4), (1, 3)),
((2, 3), (1, 3)),
((2, 3), (2, 4)),
((1, 4), (2, 4)),
((2, 5), (2, 4)),
((2, 5), (3, 5)),
((3, 5), (3, 6)),
#Mountains near colorado river
((5, 7), (5, 6)),
((5, 7), (6, 7)),
((6, 8), (6, 7)),
((7, 8), (6, 7)),
((7, 7), (7, 8)),
#Appalachians
((4, 17), (3, 16)),
((4, 17), (4, 16)),
((5, 17), (4, 16)),
((5, 17), (5, 16)),
((6, 17), (5, 16)),
((6, 17), (6, 16)),
((7, 17), (6, 16)),
((7, 17), (7, 16)),
((8, 17), (7, 16)),
((8, 17), (8, 16)),
((9, 17), (8, 16)),
((9, 17), (9, 16)),
#Ohio River
((5, 15), (6, 16)),
((5, 15), (6, 15)),
((5, 14), (6, 15)),
((6, 14), (6, 15)),
((6, 14), (7, 15)),
((7, 14), (7, 15)),
#North Mississippi
((6, 14), (7, 14)),
((6, 13), (6, 14)),
((6, 13), (5, 13)),
((5, 12), (5, 13)),
((5, 12), (4, 12)),
((4, 11), (4, 12)),
((4, 12), (3, 11)),
((3, 11), (3, 12)),
((3, 11), (2, 11)),
((2, 11), (2, 10)),
((2, 10), (1, 10)),
((1, 9), (1, 10)),
#Missouri
((6, 13), (5, 12)),
((6, 12), (5, 12)),
((5, 11), (6, 12)),
((5, 11), (6, 11)),
((5, 11), (5, 10)),
((4, 10), (5, 10)),
((4, 10), (4, 9)),
((4, 9), (3, 9)),
((3, 8), (3, 9)),
((3, 8), (2, 8)),
((2, 7), (2, 8)),
((2, 7), (1, 7)),
((1, 6), (1, 7)),
((1, 6), (0, 6)),
((1, 6), (0, 5)),
((1, 5), (0, 5)),
((1, 4), (0, 4)),
((1, 5), (0, 4)),
#South Mississippi
((7, 14), (8, 15)),
((8, 14), (8, 15)),
((8, 14), (9, 15)),
((9, 14), (9, 15)),
((9, 14), (10, 15)),
((10, 14), (10, 15)),
((11, 15), (10, 15)),
((11, 15), (11, 16)),
((11, 15), (12, 16)),
((12, 15), (12, 16)),
]
OCEANS = [
(12, 10), (12, 9), (12, 8), (12, 7), (12, 6), (12, 5), (12, 4), (12, 3), (12, 2), (12, 1), (12, 0), # pylint: disable=C0301
(11, 7), (11, 6), (11, 5), (11, 4), (11, 3), (11, 2), (11, 1), (11, 0),
(10, 5), (10, 4), (10, 3), (10, 2), (10, 1), (10, 0),
(9, 4), (9, 3), (9, 2), (9, 1), (9, 0),
(8, 3), (8, 2), (8, 1), (8, 0),
(7, 2), (7, 1), (7, 0), (7, 19),
(6, 1), (6, 0), (6, 18), (6, 19),
(5, 1), (5, 0), (5, 18), (5, 19),
(4, 0), (4, 18), (4, 19),
(3, 0), (3, 18), (3, 19),
(2, 14), (2, 13), (2, 18), (2, 19),
(1, 12), (1, 13), (1, 14), (1, 17), (1, 18), (1, 19),
(0, 10), (0, 11), (0, 12), (0, 13), (0, 14), (0, 15), (0, 16), (0, 17), (0, 18), (0, 19)
]
CORNERS = ((13, 5), (-1, 17))