-
Notifications
You must be signed in to change notification settings - Fork 1
/
boids.p8
489 lines (449 loc) · 26.2 KB
/
boids.p8
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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
pico-8 cartridge // http://www.pico-8.com
version 18
__lua__
-- boids
-- by: wojtek rak
-- based on:
-- http://www.vergenet.net/~conrad/boids/pseudocode.html
--parameters
boid_count = 10
avoid_dist = 5
speed_limit = 1.5
--rules flags
v1_enabled=true
v2_enabled=true
v3_enabled=true
v4_enabled=true
-->8
-- vectors/math helpers
function vec_add(v1,v2)
local x={x=0,y=0}
x.x=v1.x+v2.x
x.y=v1.y+v2.y
return x
end
function vec_sub(v1,v2)
local x={x=0,y=0}
x.x=v1.x-v2.x
x.y=v1.y-v2.y
return x
end
function vec_div(v,i)
local x={}
x.x=v.x/i
x.y=v.y/i
return x
end
function vec_mul(v,i)
local x={}
x.x=v.x*i
x.y=v.y*i
return x
end
function vec_diff(v1,v2)
if v1.x != v2.x and v1.y != v2.y then
return true
else
return false
end
end
function vec_dist(v1,v2)
local dist=0
dist = sqrt(pow((v1.x-v2.x),2)+pow((v1.y-v2.y),2))
return dist
end
function vec_magnitude(v)
local mag=0
mag = sqrt(pow(v.x,2)+pow(v.y,2))
return mag
end
-- todo:
-- consider using shl()???
function pow(x,a)
if (a==0) return 1
if (a<0) x,a=1/x,-a
local ret,a0,xn=1,flr(a),x
a-=a0
while a0>=1 do
if (a0%2>=1) ret*=xn
xn,a0=xn*xn,shr(a0,1)
end
while a>0 do
while a<1 do x,a=sqrt(x),a+a end
ret,a=ret*x,a-1
end
return ret
end
-->8
boids={}
goal={x=63,y=63}
function init_boids()
for i=1,boid_count do
local px,py
px=flr(rnd(127))
py=flr(rnd(127))
add(boids,{p={x=px,y=py},v={x=0,y=0},vc={x=0,y=0}})
end
end
function draw_boids()
for b in all(boids) do
spr(16,b.p.x,b.p.y)
end
end
function move_boids()
local v1,v2,v3,v4={x=0,y=0},{x=0,y=0},{x=0,y=0},{x=0,y=0}
for b in all(boids) do
-- get vectors from rules
v1 = centre_of_mass(b)
v2 = keep_distance(b)
v3 = vel_match(b)
v4 = move_to_goal(b,goal)
-- apply vectors to boid velocity
if v1_enabled then b.vc=vec_add(b.v,v1) end
if v2_enabled then b.vc=vec_add(b.vc,v2) end
if v3_enabled then b.vc=vec_add(b.vc,v3) end
if v4_enabled then b.vc=vec_add(b.vc,v4) end
-- limit velocity
vel_limit(b)
-- keep boids in screenspace
b.vc=vec_add(b.vc,limit_pos(b))
-- update velocity
b.v = b.vc
-- apply velocity to pos of boid
b.p=vec_add(b.p,b.v)
end
end
-- "rule 1"
function centre_of_mass(b)
local c={x=0,y=0}
for ob in all(boids) do
if vec_diff(b.p,ob.p) then
c=vec_add(c,ob.p)
end
end
c=vec_div(c,#boids-1)
c=vec_div(vec_sub(c,b.p),100)
return c
end
-- "rule 2"
-- keep distance from other objects
-- ob = "other boid"
-- b = "boid" -> passed into the function
function keep_distance(b)
local c = {x=0,y=0}
for ob in all(boids) do
if vec_diff(b.p,ob.p) then
if vec_dist(ob.p,b.p) < avoid_dist then
c = vec_sub(c,(vec_sub(ob.p,b.p)))
end
end
end
return c
end
-- "rule 3"
-- velocity match with near boids
function vel_match(b)
local v={x=0,y=0}
for ob in all(boids) do
if vec_diff(b.p,ob.p) then
v=vec_add(v,ob.v)
end
end
v=vec_div(v,#boids-1)
v=vec_div(vec_sub(v,b.v),20)
return v
end
-- "rule 4"
-- move towards a given target
function move_to_goal(b,t)
local v={}
v=vec_div(vec_sub(t,b.p),100)
return v
end
-- velocity limiter
function vel_limit(b)
if vec_magnitude(b.v) > speed_limit then
b.vc = vec_mul(vec_div(b.v,vec_magnitude(b.v)),speed_limit)
end
end
-- keep boids in screenspace
function limit_pos(b)
local v = {x=0,y=0}
if b.p.x > 127 then
v.x = -10
elseif b.p.x < 0 then
v.x=10
end
if b.p.y > 127 then
v.y=-10
elseif b.p.y < 0 then
v.y=10
end
return v
end
-->8
-- input and ui
goal_mode=true
cur_selection=0
function get_input()
-- move goal
if goal_mode then
if btn(0)then goal.x -= 1 end
if btn(1)then goal.x += 1 end
if btn(2)then goal.y -= 1 end
if btn(3)then goal.y += 1 end
else
if btnp(2)then cur_selection -= 1 end
if btnp(3)then cur_selection += 1 end
if cur_selection > 5 then cur_selection = 0 end
if cur_selection < 0 then cur_selection = 5 end
if cur_selection == 0 then
if btnp(0)then boid_count -= 1 end
if btnp(1)then boid_count += 1 end
elseif cur_selection == 1 then
if btnp(0)then avoid_dist -= 1 end
if btnp(1)then avoid_dist += 1 end
elseif cur_selection == 2 then
if btnp(0) or btnp(1) then v1_enabled = not v1_enabled end
elseif cur_selection == 3 then
if btnp(0) or btnp(1) then v2_enabled = not v2_enabled end
elseif cur_selection == 4 then
if btnp(0) or btnp(1) then v3_enabled = not v3_enabled end
elseif cur_selection == 5 then
if btnp(0) or btnp(1) then v4_enabled = not v4_enabled end
end
end
if btnp(4) then
if goal_mode then
goal_mode = false
else
goal_mode = true
end
end
-- reset
if btnp(5) then
reset()
end
end
function draw_ui()
if not goal_mode then
-- print the menu
oprint("flock size:"..boid_count,12,2,7)
oprint("avoid distance:"..avoid_dist,12,10,7)
oprint("center of mass:"..tostr(v1_enabled),12,18,7)
oprint("keep distance:"..tostr(v2_enabled),12,26,7)
oprint("velocity match:"..tostr(v3_enabled),12,34,7)
oprint("follow goal:"..tostr(v4_enabled),12,42,7)
-- print the cursor
if cur_selection == 0 then oprint("◆",2,2,7) end
if cur_selection == 1 then oprint("◆",2,10,7) end
if cur_selection == 2 then oprint("◆",2,18,7) end
if cur_selection == 3 then oprint("◆",2,26,7) end
if cur_selection == 4 then oprint("◆",2,34,7) end
if cur_selection == 5 then oprint("◆",2,42,7) end
else
oprint("press 'z' to use the menu",13,2)
end
boid_count_check()
end
function draw_goal()
spr(48,goal.x,goal.y)
end
function oprint(txt,x,y)
for o_x=-1,1 do
for o_y=-1,1 do
print(txt,x+o_x,y+o_y,0)
end
end
print(txt,x,y,7)
end
function boid_count_check()
if #boids != boid_count then
oprint("x - reset to see changes", 14, 120, 7)
end
end
-->8
function reset()
boids={}
init_boids()
end
-->8
-- main
function _init()
init_boids()
end
function _update()
get_input()
move_boids()
end
function _draw()
cls(15)
-- draw the goal
spr(48,goal.x,goal.y)
draw_boids()
draw_ui()
end
__gfx__
00000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000001cc1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0070070001c77c100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0007700001c77c100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000770001c7777c10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
007007001cccccc10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000001c1111c10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000010000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00666600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
06777760000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
67766776000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
676ce676000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
6769a676000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
67766776000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
06777760000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00666600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00888800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
08888880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
88888888000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
88888888000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
88888888000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
88888888000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
08888880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00888800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
__label__
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
88888eeeeee888eeeeee888777777888eeeeee888eeeeee888eeeeee888888888888888888888888888ff8ff8888228822888222822888888822888888228888
8888ee888ee88ee88eee88778887788ee888ee88ee8e8ee88ee888ee88888888888888888888888888ff888ff888222222888222822888882282888888222888
888eee8e8ee8eeee8eee8777778778eeeee8ee8eee8e8ee8eee8eeee88888e88888888888888888888ff888ff888282282888222888888228882888888288888
888eee8e8ee8eeee8eee8777888778eeee88ee8eee888ee8eee888ee8888eee8888888888888888888ff888ff888222222888888222888228882888822288888
888eee8e8ee8eeee8eee8777877778eeeee8ee8eeeee8ee8eeeee8ee88888e88888888888888888888ff888ff888822228888228222888882282888222288888
888eee888ee8eee888ee8777888778eee888ee8eeeee8ee8eee888ee888888888888888888888888888ff8ff8888828828888228222888888822888222888888
888eeeeeeee8eeeeeeee8777777778eeeeeeee8eeeeeeee8eeeeeeee888888888888888888888888888888888888888888888888888888888888888888888888
5e555e5e5e5e55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
5ee55e5e5e5e55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
5e555e5e5e5e55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
5eee5e5e5eee55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
5eee5e5e5ee555ee5eee5eee55ee5ee5555556655666566656565555566655665666566555665575557555555555555555555555555555555555555555555555
5e555e5e5e5e5e5555e555e55e5e5e5e555556565656565656565555565656565565565656555755555755555555555555555555555555555555555555555555
5ee55e5e5e5e5e5555e555e55e5e5e5e555556565665566656565555566556565565565656665755555755555555555555555555555555555555555555555555
5e555e5e5e5e5e5555e555e55e5e5e5e555556565656565656665555565656565565565655565755555755555555555555555555555555555555555555555555
5e5555ee5e5e55ee55e55eee5ee55e5e555556665656565656665666566656655666566656655575557555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555eee55ee5eee5555566655665666566555555eee5ee555555bbb5b555b55557556665566566656655566557555555ee555ee555555555555555555555555
55555e555e5e5e5e55555656565655655656555555e55e5e55555b5b5b555b55575556565656556556565655555755555e5e5e5e555555555555555555555555
55555ee55e5e5ee555555665565655655656555555e55e5e55555bbb5b555b55575556655656556556565666555755555e5e5e5e555555555555555555555555
55555e555e5e5e5e55555656565655655656555555e55e5e55555b5b5b555b55575556565656556556565556555755555e5e5e5e555555555555555555555555
55555e555ee55e5e5555566656655666566655555eee5e5e55555b5b5bbb5bbb557556665665566656665665557555555eee5ee5555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
5555555555bb5bbb5bbb55755cc55c55555556665566566656655555565655555666556656665665555556565575555555555555555555555555555555555555
555555555b555b5b5b5b575555c55c55555556565656556556565555565655555656565655655656555556565557555555555555555555555555555555555555
555555555bbb5bbb5bb5575555c55ccc555556655656556556565555556555555665565655655656555556665557555555555555555555555555555555555555
55555555555b5b555b5b575555c55c5c557556565656556556565555565655755656565655655656555555565557555555555555555555555555555555555555
555555555bb55b555b5b55755ccc5ccc575556665665566656665575565657555666566556665666557556665575555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555eee5ee55ee55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555e555e5e5e5e5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555ee55e5e5e5e5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555e555e5e5e5e5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555eee5e5e5eee5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
5eee5ee55ee555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
5e555e5e5e5e55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
5ee55e5e5e5e55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
5e555e5e5e5e55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
5eee5e5e5eee55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555515555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555171555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555177155555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
5eee5e5e5ee555ee5eee5eee55ee5177715556665566565656665555566655665666566555665575557555555555555555555555555555555555555555555555
5e555e5e5e5e5e5555e555e55e5e5177771556665656565656555555565656565565565656555755555755555555555555555555555555555555555555555555
5ee55e5e5e5e5e5555e555e55e5e5177115556565656565656655555566556565565565656665755555755555555555555555555555555555555555555555555
5e555e5e5e5e5e5555e555e55e5e5e11715556565656566656555555565656565565565655565755555755555555555555555555555555555555555555555555
5e5555ee5e5e55ee55e55eee5ee55e5e555556565665556556665666566656655666566656655575557555555555555555555555555555555555555555555555
5555aaaaaaaaa5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
5555a6a6a66aa5555656566655555656566655555577565655555ccc5555565655555ccc57755555555555555555555555555555555555555555555555555555
5555a6a6aa6aa5555656555655555656555657775575565657775c5c5555565657775c5c55755555555555555555555555555555555555555555555555555555
5555a6a6aa6aa5555656566655555656556655555775556555555c5c5555566655555c5c55775555555555555555555555555555555555555555555555555555
5555a666aa6aa5755666565555755666555657775575565657775c5c5575555657775c5c55755555555555555555555555555555555555555555555555555555
5555aa6aa666a7555565566657555565566655555577565655555ccc5755566655555ccc57755555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555eee55ee5eee5555566655555eee5ee555555bbb5b555b55557556665566566656655566557555555ee555ee555555555555555555555555555555555555
55555e555e5e5e5e55555656555555e55e5e55555b5b5b555b55575556565656556556565655555755555e5e5e5e555555555555555555555555555555555555
55555ee55e5e5ee555555665555555e55e5e55555bbb5b555b55575556655656556556565666555755555e5e5e5e555555555555555555555555555555555555
55555e555e5e5e5e55555656555555e55e5e55555b5b5b555b55575556565656556556565556555755555e5e5e5e555555555555555555555555555555555555
55555e555ee55e5e5555566655555eee5e5e55555b5b5bbb5bbb557556665665566656665665557555555eee5ee5555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
555555555665566656665656556655555566556656565665566655555665566656665656556655555566556656565665566655555cc555555555555555555555
5555555556565655565656565655555556555656565656565565577756565655565656565655555556555656565656565565557555c555555555555555555555
5555555556565665566556565655555556555656565656565565555556565665566556565655555556555656565656565565577755c555555555555555555555
5555555556565655565656565656555556555656565656565565577756565655565656565656555556555656565656565565557555c555555555555555555555
555555555666566656665566566656665566566555665656556555555666566656665566566656665566566555665656556555555ccc55555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555565656655555555555555566566656655666566656665555556656665555566656665566556655755666557555555555555555555555555555555555
55555555565655655555577755555655565556565565565656555555565656555555566656565655565557555656555755555555555555555555555555555555
55555555565655655555555555555655566556565565566556655555565656655555565656665666566657555665555755555555555555555555555555555555
55555555566655655555577755555655565556565565565656555555565656555555565656565556555657555656555755555555555555555555555555555555
55555555556556665555555555555566566656565565565656665666566556555666565656565665566555755666557555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555565656665555555555555656566656665666555556655666556656665666566555665666557556665575555555555555555555555555555555555555
55555555565655565555577755555656565556555656555556565565565555655656565656555655575556565557555555555555555555555555555555555555
55555555565656665555555555555665566556655666555556565565566655655666565656555665575556655557555555555555555555555555555555555555
55555555566656555555577755555656565556555655555556565565555655655656565656555655575556565557555555555555555555555555555555555555
55555555556556665555555555555656566656665655566656665666566555655656565655665666557556665575555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555565656665555555555555656566656555555566656665666556656565575566655755555555555555555555555555555555555555555555555555555
55555555565655565555577755555656565556555555566656565565565556565755565655575555555555555555555555555555555555555555555555555555
55555555565655665555555555555656566556555555565656665565565556665755566555575555555555555555555555555555555555555555555555555555
55555555566655565555577755555666565556555555565656565565565556565755565655575555555555555555555555555555555555555555555555555555
55555555556556665555555555555565566656665666565656565565556656565575566655755555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555566655555656566656555555566655555656566656555555565656655555565656665555565656665555555555555555555555555555555555555555
55555555565655555656565556555777565655555656565556555575565655655575565655565575565655565555555555555555555555555555555555555555
55555555566555555656566556555555566555555656566556555777565655655777565656665777565655665555555555555555555555555555555555555555
55555555565655555666565556555777565655555666565556555575566655655575566656555575566655565555555555555555555555555555555555555555
55555555566655755565566656665555566655755565566656665555556556665555556556665555556556665555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
55555555566655555656555556665555565655555666555556565666565555555555555555555555555555555555555555555555555555555555555555555555
55555555565655555656577756565555565655755656555556565655565555555555555555555555555555555555555555555555555555555555555555555555
55555555566555555565555556655555556557775665555556565665565555555555555555555555555555555555555555555555555555555555555555555555
55555555565655555656577756565555565655755656555556665655565555555555555555555555555555555555555555555555555555555555555555555555
55555555566655755656555556665575565655555666557555655666566655555555555555555555555555555555555555555555555555555555555555555555
55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
82888222822882228888822882228882822282228888888888888888888888888888888888888888888888888222828282228882822282288222822288866688
82888828828282888888882882828828828288828888888888888888888888888888888888888888888888888288828282888828828288288282888288888888
82888828828282288888882882228828822282228888888888888888888888888888888888888888888888888222822282228828822288288222822288822288
82888828828282888888882888828828828282888888888888888888888888888888888888888888888888888882888288828828828288288882828888888888
82228222828282228888822288828288822282228888888888888888888888888888888888888888888888888222888282228288822282228882822288822288
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
__sfx__
000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010500000000000000000000000000000000000000000000000000000000