-
Notifications
You must be signed in to change notification settings - Fork 0
/
day14.py
executable file
·328 lines (307 loc) · 30.6 KB
/
day14.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
import os
import time
oldInp = '''498,4 -> 498,6 -> 496,6
503,4 -> 502,4 -> 502,9 -> 494,9'''
inp = '''500,30 -> 504,30
503,28 -> 507,28
477,136 -> 477,133 -> 477,136 -> 479,136 -> 479,135 -> 479,136 -> 481,136 -> 481,127 -> 481,136 -> 483,136 -> 483,131 -> 483,136 -> 485,136 -> 485,129 -> 485,136 -> 487,136 -> 487,135 -> 487,136
496,97 -> 496,99 -> 488,99 -> 488,103 -> 508,103 -> 508,99 -> 502,99 -> 502,97
537,66 -> 541,66
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
479,85 -> 479,87 -> 473,87 -> 473,94 -> 486,94 -> 486,87 -> 483,87 -> 483,85
540,64 -> 544,64
477,136 -> 477,133 -> 477,136 -> 479,136 -> 479,135 -> 479,136 -> 481,136 -> 481,127 -> 481,136 -> 483,136 -> 483,131 -> 483,136 -> 485,136 -> 485,129 -> 485,136 -> 487,136 -> 487,135 -> 487,136
528,68 -> 532,68
477,136 -> 477,133 -> 477,136 -> 479,136 -> 479,135 -> 479,136 -> 481,136 -> 481,127 -> 481,136 -> 483,136 -> 483,131 -> 483,136 -> 485,136 -> 485,129 -> 485,136 -> 487,136 -> 487,135 -> 487,136
537,62 -> 541,62
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
500,34 -> 504,34
477,136 -> 477,133 -> 477,136 -> 479,136 -> 479,135 -> 479,136 -> 481,136 -> 481,127 -> 481,136 -> 483,136 -> 483,131 -> 483,136 -> 485,136 -> 485,129 -> 485,136 -> 487,136 -> 487,135 -> 487,136
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
482,82 -> 498,82 -> 498,81
486,115 -> 486,117 -> 484,117 -> 484,123 -> 494,123 -> 494,117 -> 490,117 -> 490,115
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
546,64 -> 550,64
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
530,50 -> 530,53 -> 523,53 -> 523,57 -> 541,57 -> 541,53 -> 534,53 -> 534,50
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
506,34 -> 510,34
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
503,108 -> 508,108
512,34 -> 516,34
561,77 -> 561,78 -> 578,78 -> 578,77
515,32 -> 519,32
543,62 -> 547,62
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
534,64 -> 538,64
514,110 -> 519,110
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
543,66 -> 547,66
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
477,136 -> 477,133 -> 477,136 -> 479,136 -> 479,135 -> 479,136 -> 481,136 -> 481,127 -> 481,136 -> 483,136 -> 483,131 -> 483,136 -> 485,136 -> 485,129 -> 485,136 -> 487,136 -> 487,135 -> 487,136
503,32 -> 507,32
504,112 -> 509,112
561,77 -> 561,78 -> 578,78 -> 578,77
479,85 -> 479,87 -> 473,87 -> 473,94 -> 486,94 -> 486,87 -> 483,87 -> 483,85
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
512,30 -> 516,30
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
496,97 -> 496,99 -> 488,99 -> 488,103 -> 508,103 -> 508,99 -> 502,99 -> 502,97
500,110 -> 505,110
488,161 -> 493,161
549,66 -> 553,66
486,115 -> 486,117 -> 484,117 -> 484,123 -> 494,123 -> 494,117 -> 490,117 -> 490,115
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
494,34 -> 498,34
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
530,50 -> 530,53 -> 523,53 -> 523,57 -> 541,57 -> 541,53 -> 534,53 -> 534,50
477,136 -> 477,133 -> 477,136 -> 479,136 -> 479,135 -> 479,136 -> 481,136 -> 481,127 -> 481,136 -> 483,136 -> 483,131 -> 483,136 -> 485,136 -> 485,129 -> 485,136 -> 487,136 -> 487,135 -> 487,136
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
546,68 -> 550,68
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
511,112 -> 516,112
547,73 -> 547,74 -> 567,74
496,97 -> 496,99 -> 488,99 -> 488,103 -> 508,103 -> 508,99 -> 502,99 -> 502,97
496,97 -> 496,99 -> 488,99 -> 488,103 -> 508,103 -> 508,99 -> 502,99 -> 502,97
518,34 -> 522,34
486,115 -> 486,117 -> 484,117 -> 484,123 -> 494,123 -> 494,117 -> 490,117 -> 490,115
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
482,140 -> 482,141 -> 489,141 -> 489,140
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
496,97 -> 496,99 -> 488,99 -> 488,103 -> 508,103 -> 508,99 -> 502,99 -> 502,97
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
477,136 -> 477,133 -> 477,136 -> 479,136 -> 479,135 -> 479,136 -> 481,136 -> 481,127 -> 481,136 -> 483,136 -> 483,131 -> 483,136 -> 485,136 -> 485,129 -> 485,136 -> 487,136 -> 487,135 -> 487,136
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
477,136 -> 477,133 -> 477,136 -> 479,136 -> 479,135 -> 479,136 -> 481,136 -> 481,127 -> 481,136 -> 483,136 -> 483,131 -> 483,136 -> 485,136 -> 485,129 -> 485,136 -> 487,136 -> 487,135 -> 487,136
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
477,136 -> 477,133 -> 477,136 -> 479,136 -> 479,135 -> 479,136 -> 481,136 -> 481,127 -> 481,136 -> 483,136 -> 483,131 -> 483,136 -> 485,136 -> 485,129 -> 485,136 -> 487,136 -> 487,135 -> 487,136
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
479,85 -> 479,87 -> 473,87 -> 473,94 -> 486,94 -> 486,87 -> 483,87 -> 483,85
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
496,97 -> 496,99 -> 488,99 -> 488,103 -> 508,103 -> 508,99 -> 502,99 -> 502,97
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
496,97 -> 496,99 -> 488,99 -> 488,103 -> 508,103 -> 508,99 -> 502,99 -> 502,97
552,68 -> 556,68
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
506,26 -> 510,26
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
479,85 -> 479,87 -> 473,87 -> 473,94 -> 486,94 -> 486,87 -> 483,87 -> 483,85
479,85 -> 479,87 -> 473,87 -> 473,94 -> 486,94 -> 486,87 -> 483,87 -> 483,85
494,157 -> 499,157
486,115 -> 486,117 -> 484,117 -> 484,123 -> 494,123 -> 494,117 -> 490,117 -> 490,115
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
530,50 -> 530,53 -> 523,53 -> 523,57 -> 541,57 -> 541,53 -> 534,53 -> 534,50
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
486,115 -> 486,117 -> 484,117 -> 484,123 -> 494,123 -> 494,117 -> 490,117 -> 490,115
498,159 -> 503,159
510,108 -> 515,108
530,50 -> 530,53 -> 523,53 -> 523,57 -> 541,57 -> 541,53 -> 534,53 -> 534,50
477,136 -> 477,133 -> 477,136 -> 479,136 -> 479,135 -> 479,136 -> 481,136 -> 481,127 -> 481,136 -> 483,136 -> 483,131 -> 483,136 -> 485,136 -> 485,129 -> 485,136 -> 487,136 -> 487,135 -> 487,136
477,136 -> 477,133 -> 477,136 -> 479,136 -> 479,135 -> 479,136 -> 481,136 -> 481,127 -> 481,136 -> 483,136 -> 483,131 -> 483,136 -> 485,136 -> 485,129 -> 485,136 -> 487,136 -> 487,135 -> 487,136
479,85 -> 479,87 -> 473,87 -> 473,94 -> 486,94 -> 486,87 -> 483,87 -> 483,85
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
534,68 -> 538,68
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
477,136 -> 477,133 -> 477,136 -> 479,136 -> 479,135 -> 479,136 -> 481,136 -> 481,127 -> 481,136 -> 483,136 -> 483,131 -> 483,136 -> 485,136 -> 485,129 -> 485,136 -> 487,136 -> 487,135 -> 487,136
486,115 -> 486,117 -> 484,117 -> 484,123 -> 494,123 -> 494,117 -> 490,117 -> 490,115
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
477,136 -> 477,133 -> 477,136 -> 479,136 -> 479,135 -> 479,136 -> 481,136 -> 481,127 -> 481,136 -> 483,136 -> 483,131 -> 483,136 -> 485,136 -> 485,129 -> 485,136 -> 487,136 -> 487,135 -> 487,136
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
477,136 -> 477,133 -> 477,136 -> 479,136 -> 479,135 -> 479,136 -> 481,136 -> 481,127 -> 481,136 -> 483,136 -> 483,131 -> 483,136 -> 485,136 -> 485,129 -> 485,136 -> 487,136 -> 487,135 -> 487,136
482,140 -> 482,141 -> 489,141 -> 489,140
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
497,112 -> 502,112
509,28 -> 513,28
530,50 -> 530,53 -> 523,53 -> 523,57 -> 541,57 -> 541,53 -> 534,53 -> 534,50
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
547,73 -> 547,74 -> 567,74
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
540,60 -> 544,60
482,82 -> 498,82 -> 498,81
477,136 -> 477,133 -> 477,136 -> 479,136 -> 479,135 -> 479,136 -> 481,136 -> 481,127 -> 481,136 -> 483,136 -> 483,131 -> 483,136 -> 485,136 -> 485,129 -> 485,136 -> 487,136 -> 487,135 -> 487,136
477,136 -> 477,133 -> 477,136 -> 479,136 -> 479,135 -> 479,136 -> 481,136 -> 481,127 -> 481,136 -> 483,136 -> 483,131 -> 483,136 -> 485,136 -> 485,129 -> 485,136 -> 487,136 -> 487,135 -> 487,136
502,161 -> 507,161
477,136 -> 477,133 -> 477,136 -> 479,136 -> 479,135 -> 479,136 -> 481,136 -> 481,127 -> 481,136 -> 483,136 -> 483,131 -> 483,136 -> 485,136 -> 485,129 -> 485,136 -> 487,136 -> 487,135 -> 487,136
506,30 -> 510,30
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
531,66 -> 535,66
491,159 -> 496,159
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
518,112 -> 523,112
561,77 -> 561,78 -> 578,78 -> 578,77
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
486,115 -> 486,117 -> 484,117 -> 484,123 -> 494,123 -> 494,117 -> 490,117 -> 490,115
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47
530,50 -> 530,53 -> 523,53 -> 523,57 -> 541,57 -> 541,53 -> 534,53 -> 534,50
497,32 -> 501,32
540,68 -> 544,68
530,50 -> 530,53 -> 523,53 -> 523,57 -> 541,57 -> 541,53 -> 534,53 -> 534,50
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
482,154 -> 482,152 -> 482,154 -> 484,154 -> 484,149 -> 484,154 -> 486,154 -> 486,146 -> 486,154 -> 488,154 -> 488,153 -> 488,154 -> 490,154 -> 490,144 -> 490,154 -> 492,154 -> 492,147 -> 492,154 -> 494,154 -> 494,151 -> 494,154 -> 496,154 -> 496,151 -> 496,154
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
482,140 -> 482,141 -> 489,141 -> 489,140
509,32 -> 513,32
479,85 -> 479,87 -> 473,87 -> 473,94 -> 486,94 -> 486,87 -> 483,87 -> 483,85
506,106 -> 511,106
507,110 -> 512,110
495,161 -> 500,161
491,23 -> 491,15 -> 491,23 -> 493,23 -> 493,18 -> 493,23 -> 495,23 -> 495,15 -> 495,23 -> 497,23 -> 497,15 -> 497,23 -> 499,23 -> 499,18 -> 499,23 -> 501,23 -> 501,14 -> 501,23 -> 503,23 -> 503,21 -> 503,23 -> 505,23 -> 505,19 -> 505,23 -> 507,23 -> 507,15 -> 507,23
514,47 -> 514,41 -> 514,47 -> 516,47 -> 516,42 -> 516,47 -> 518,47 -> 518,42 -> 518,47 -> 520,47 -> 520,44 -> 520,47 -> 522,47 -> 522,44 -> 522,47 -> 524,47 -> 524,42 -> 524,47 -> 526,47 -> 526,38 -> 526,47 -> 528,47 -> 528,43 -> 528,47 -> 530,47 -> 530,44 -> 530,47'''
class TileItem:
def __init__(self):
self.isSand = False
self.isStoppedSand = False
self.isRock = False
self.x = 0
self.y = 0
def __str__(self):
return str((self.x, self.y))
tlxTlyBrxBry = [500,0,0,0]
bottom_y = 0
sand_stopped = 0
tiles: dict = {}
sand_key = ""
sourceLoc = (500, 0)
def initRock(rock: str) -> None:
global bottom_y
path_acc = []
rocks_to_add = set()
nodes = rock.split(" -> ")
for node in nodes:
nums = node.split(',')
path_acc.append( (int(nums[0]), int(nums[1])) )
#print(path_acc)
for i in range(0, len(path_acc) -1):
rock_pair = (path_acc[i], path_acc[i + 1])
# y values are the same
if rock_pair[0][1] == rock_pair[1][1]:
# left x is smaller than right x
if rock_pair[0][0] < rock_pair[1][0]:
for x in range(rock_pair[0][0], rock_pair[1][0]+1):
rocks_to_add.add((x, rock_pair[0][1]))
else:
for x in range(rock_pair[0][0], rock_pair[1][0]-1, -1):
rocks_to_add.add((x, rock_pair[0][1]))
# x values are the same
if rock_pair[0][0] == rock_pair[1][0]:
# left y is smaller than right y
if rock_pair[0][1] < rock_pair[1][1]:
for y in range(rock_pair[0][1], rock_pair[1][1]+1):
rocks_to_add.add((rock_pair[0][0], y))
else:
for y in range(rock_pair[0][1], rock_pair[1][1]-1, -1):
rocks_to_add.add((rock_pair[0][0], y))
print(rocks_to_add)
for rock in rocks_to_add:
if rock[1] > bottom_y:
bottom_y = rock[1]
tlxTlyBrxBry[3] = rock[1] + 2
if rock[0]< tlxTlyBrxBry[0] + 2:
tlxTlyBrxBry[0] = rock[0] - 2
if rock[0]> tlxTlyBrxBry[2] - 2:
tlxTlyBrxBry[2] = rock[0] + 2
new_it = TileItem()
new_it.x = rock[0]
new_it.y = rock[1]
new_it.isRock = True
tiles[str(new_it)] = new_it
def initSand() -> bool:
global sand_key
target = (sourceLoc[0], sourceLoc[1])
if not str(target) in tiles:
new_sand = TileItem()
new_sand.x, new_sand.y = target
new_sand.isSand = True
sand_key = str(new_sand)
tiles[sand_key] = new_sand
return True
return False
# True for cont. False for end
def updateSand() -> bool:
global sand_key
global sand_stopped
moves = ((0, 1), (-1, 1), (1, 1))
sand_loc = (tiles[sand_key].x, tiles[sand_key].y)
for move in moves:
new_sand_loc = (sand_loc[0] + move[0], sand_loc[1] + move[1])
# sand reached abyss
#if new_sand_loc[1] == bottom_y + 1:
# return False
# can move into space
if not str(new_sand_loc) in tiles and not(new_sand_loc[1] == bottom_y + 2):
new_sand = TileItem()
new_sand.isSand = True
new_sand.x, new_sand.y = new_sand_loc
sand_key = str(new_sand_loc)
tiles[sand_key] = new_sand
tiles.pop(str(sand_loc))
return True
# sand is still
tiles[str(sand_loc)].isSand = False
tiles[str(sand_loc)].isStoppedSand = True
sand_stopped += 1
if not initSand():
return False
return True
def printGrid(topLeft, bottomRight) -> None:
tlx, tly = topLeft
brx, bry = bottomRight
for y in range(tly, bry + 1):
toPrint = []
for x in range(tlx, brx + 1, 1):
key = str((x, y))
if (x, y) == sourceLoc:
toPrint.append('\x1b[0;34;40m' + '+' + '\x1b[0m')
elif y == bottom_y + 2:
toPrint.append('\x1b[0;35;40m' + '=' + '\x1b[0m')
elif not key in tiles:
toPrint.append('\x1b[0;37;40m' + '.' + '\x1b[0m')
elif tiles[key].isSand:
toPrint.append('\x1b[0;33;40m' + 'O' + '\x1b[0m')
elif tiles[key].isStoppedSand:
toPrint.append('\x1b[0;33;40m' + 'o' + '\x1b[0m')
elif tiles[key].isRock:
toPrint.append('\x1b[0;31;40m' + '#' + '\x1b[0m')
print(*toPrint, sep=None)
for line in oldInp.splitlines():
initRock(line)
printGrid((tlxTlyBrxBry[0], tlxTlyBrxBry[1]), (tlxTlyBrxBry[2], tlxTlyBrxBry[2]))
initSand()
while(updateSand()):
#pass
#_ = os.system('clear')
print("\033c", end="")
printGrid((tlxTlyBrxBry[0], tlxTlyBrxBry[1]), (tlxTlyBrxBry[2], tlxTlyBrxBry[3]))
time.sleep(0.15)
print(sand_stopped)