-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwindy.p8
1193 lines (1003 loc) · 51.5 KB
/
windy.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
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
pico-8 cartridge // http://www.pico-8.com
version 5
__lua__
-- debug
skip_draw_particles = true
v = "0.0.4"
-- moving speed of actor
sx = 3
sy = 3
-- current sx and sy for controllables
csx = 0
csy = 0
frame = 0
-- physics parameters
gravity = 0.3
friction = 0.98
bounce = 0.9
wind_x = -0.15
wind_y = -0.4
init_wind_x = wind_x
init_wind_y = wind_y
wind_max_x = 4.5
wind_max_y = 2.5
wind_hit_chance = 0.05
wind_control_strength = 0.1
ripple_quantity = 100
ripple_max_radius = 100
--
max_points = 1000
-- base of the curtain
x = 49
y = 21
points = {}
sticks = {}
triangles = {}
windy = {}
-- fabric colors
fc1 = 7
fc2 = 6
fc3 = 15
fc4 = 5
-- fabric resistance
resist_x = 5.5
resist_y = 4
did_jump = false
--
-- math utils
--
ease = 0.1
sqrt0 = sqrt
function sqrt(n)
if (n <= 0) return 0
if (n >= 32761) return 181.0
return sqrt0(n)
end
function distance(p0, p1)
local dx = p0.x - p1.x
local dy = p0.y - p1.y
return sqrt(dx*dx+dy*dy)
end
function clip(v)
return max(-1,min(128,v))
end
function lerp(a,b,alpha)
return a*(1.0-alpha)+b*alpha
end
-- written by nusan
-- taken from Pico8 3d Renderer http://www.lexaloffle.com/bbs/?tid=2731&autoplay=1#pp
-- by orange451
function trifill2( p1, p2, p3, c )
local v1 = p1
local v2 = p2
local v3 = p3
local x1 = flr(p1.x)
local y1 = flr(p1.y)
local x2 = flr(p2.x)
local y2 = flr(p2.y)
local x3 = flr(p3.x)
local y3 = flr(p3.y)
-- order triangle points so that y1 is on top
if(y2<y1) then
if(y3<y2) then
local tmp = y1
y1 = y3
y3 = tmp
tmp = x1
x1 = x3
x3 = tmp
else
local tmp = y1
y1 = y2
y2 = tmp
tmp = x1
x1 = x2
x2 = tmp
end
else
if(y3<y1) then
local tmp = y1
y1 = y3
y3 = tmp
tmp = x1
x1 = x3
x3 = tmp
end
end
y1 += 0.001 -- offset to avoid divide per 0
local miny = min(y2,y3)
local maxy = max(y2,y3)
local fx = x2
if(y2<y3) then
fx = x3
end
local d12 = (y2-y1)
if(d12 != 0) d12 = 1.0/d12
local d13 = (y3-y1)
if(d13 != 0) d13 = 1.0/d13
local cl_y1 = clip(y1)
local cl_miny = clip(miny)
local cl_maxy = clip(maxy)
for y=cl_y1,cl_miny do
local sx = lerp(x1,x3, (y-y1) * d13 )
local ex = lerp(x1,x2, (y-y1) * d12 )
rectfill(sx,y,ex,y,c)
end
local sx = lerp(x1,x3, (miny-y1) * d13 )
local ex = lerp(x1,x2, (miny-y1) * d12 )
local df = (maxy-miny)
if(df != 0) df = 1.0/df
for y=cl_miny,cl_maxy do
local sx2 = lerp(sx,fx, (y-miny) * df )
local ex2 = lerp(ex,fx, (y-miny) * df )
rectfill(sx2,y,ex2,y,c)
end
end
--
-- triangle fill ported by yellowafterlife
-- https://gist.github.com/yellowafterlife/34de710baa4422b22c3e
-- from http://forum.devmaster.net/t/advanced-rasterization/6145
-- edit for cleaner seams by @cauli
--
function trifill(p1, p2, p3)
local x1 = p1.x
local y1 = p1.y
local x2 = p2.x
local y2 = p2.y
local x3 = p3.x
local y3 = p3.y
local dx12 = x1 - x2
local dx23 = x2 - x3
local dx31 = x3 - x1
local dy12 = y1 - y2
local dy23 = y2 - y3
local dy31 = y3 - y1
local minx = min(x1, min(x2, x3))
local maxx = max(x1, max(x2, x3))
local miny = min(y1, min(y2, y3))
local maxy = max(y1, max(y2, y3))
local c1 = dy12 * x1 - dx12 * y1
local c2 = dy23 * x2 - dx23 * y2
local c3 = dy31 * x3 - dx31 * y3
if dy12 < 0 or dy12 == 0 and dx12 > 0 then
c1 += 1
end
if dy23 < 0 or dy23 == 0 and dx23 > 0 then
c2 += 1
end
if dy31 < 0 or dy31 == 0 and dx31 > 0 then
c3 += 1
end
local cy1 = c1 + dx12 * miny - dy12 * minx
local cy2 = c2 + dx23 * miny - dy23 * minx
local cy3 = c3 + dx31 * miny - dy31 * minx
for y = flr(miny), flr(maxy) do
local cx1 = cy1
local cx2 = cy2
local cx3 = cy3
for x = flr(minx), flr(maxx) do
if cx1 > -5 and cx2 > -5 and cx3 > -5 then
pset(x, y)
end
cx1 -= dy12
cx2 -= dy23
cx3 -= dy31
end
cy1 += dx12
cy2 += dx23
cy3 += dx31
end
end
--
-- make functions
--
function make_stick(p0,p1,horizontal, triangles, i)
local s = {}
s.triangles = triangles
s.p0 = p0
s.p1 = p1
s.length = distance(p0,p1)
s.horizontal = horizontal
s.i = i
add(sticks, s)
add(p0.sticks, s)
add(p1.sticks, s)
return s
end
--
-- make triangle
--
function make_triangle(p0, p1, p2, inverted, color)
local t = {}
t.p0 = p0
t.p1 = p1
t.p2 = p2
t.inverted = inverted
t.color = color
return t
end
function particle(x,y,fixed,controllable)
local p = {}
p.x = x
p.y = y
p.oldx = x-1
p.oldy = y-1
p.vx = vx
p.vy = vy
p.color = flr(6+rnd(6))
p.fixed = fixed
p.sticks = {}
p.controllable = controllable
return p
end
cloud_circles = {}
total_cloud_width = 0
cloud_circles_fg = {}
total_cloud_width_fg = 0
function make_cloud_circle(sx, sy, r, color,i)
local c = {}
c.x = sx
c.y = sy - ( sin(1/i) * 10 )
c.r = r
c.color = color
return c
end
--
-- draw functions
--
function make_clouds(cloud_circles_array, r, c)
if(cloud_circles_array == cloud_circles_fg)then
yi = 40
else
yi = 57
end
for i=1,count(r) do
total_cloud_width += r[i]
end
for i=1,count(r) do
-- sum all radius from before
if(i==1)then
ix = 0
else
ix = 0
for j=1,i do
ix += r[j]
end
end
add(cloud_circles_array, make_cloud_circle(ix-5,yi,r[i],c,i))
end
end
function move_clouds(cloud_circles_array)
max_x = -100
min_x = 200
cur_max = -1
if(cloud_circles_array == cloud_circles)then
mp = 0.4
else
mp = 0.2
end
for i=1,count(cloud_circles_array) do
local lastmax = max_x
max_x = max(cloud_circles_array[i].x + cloud_circles_array[i].r -2 , max_x)
if(max_x != lastmax)then
cur_max = i
end
min_x = min(cloud_circles_array[i].x - cloud_circles_array[i].r + 2, min_x)
end
for i=1,count(cloud_circles_array) do
cloud_circles_array[i].x += wind_x*mp
if(cloud_circles_array[i].x < -cloud_circles_array[i].r and wind_x < 0.0)then
cloud_circles_array[i].x = max_x + cloud_circles_array[i].r
elseif(cloud_circles_array[i].x > 40 + cloud_circles_array[i].r and wind_x > 0.0)then
cloud_circles_array[i].x = min_x - cloud_circles_array[i].r
end
end
end
function draw_clouds()
color(cloud_circles_fg[1].color)
rectfill(0,55,40,400)
color(cloud_circles[1].color)
rectfill(0,56,40,400)
for i=1,count(cloud_circles_fg) do
color(cloud_circles_fg[i].color)
circfill(cloud_circles_fg[i].x,cloud_circles_fg[i].y,cloud_circles_fg[i].r)
rectfill(cloud_circles_fg[i].x-cloud_circles_fg[i].r, cloud_circles_fg[i].y,cloud_circles_fg[i].x+cloud_circles_fg[i].r, cloud_circles_fg[i].y+50)
end
for i=1,count(cloud_circles) do
color(cloud_circles[i].color)
circfill(cloud_circles[i].x,cloud_circles[i].y,cloud_circles[i].r)
rectfill(cloud_circles[i].x-cloud_circles[i].r, cloud_circles[i].y,cloud_circles[i].x+cloud_circles[i].r, cloud_circles[i].y+50)
end
end
function draw_particle(p)
color(p.color)
rectfill(p.x,p.y,p.x,p.y)
end
function draw_stick(s)
color(fc3)
if(s.horizontal)then
-- dont draw first horizontal stick. it is weird
color(fc3)
return line(s.p0.x,s.p0.y,s.p1.x,s.p1.y)
end
color(fc1)
line(s.p0.x,s.p0.y,s.p1.x,s.p1.y)
end
function draw_triangle(t)
if(count(t.p1.sticks) == 1 or count(t.p0.sticks) == 1 or count(t.p2.sticks) == 1)then
del(triangles,t)
return
end
color(t.color)
trifill2(t.p1,t.p0,t.p2,t.color)
end
function draw_scene()
-- draw sky
color(12)
rectfill(0,0,128,128)
draw_clouds()
-- draw wall
color(5)
rectfill(38,0,128,400)
-- draw window black
color(0)
rectfill(38,28,51+60,28+70)
draw_window(0,0)
end
function draw_window(x,y)
-- draw window black
color(0)
rectfill(x+38,y+28,x+51+60,y+28+70)
palt(0,false)
map(4,0, x+42,y+97, 12,2 )
map(15,0, x+115,y+28, 1,10 )
palt(0,true)
map(0,0, x+28,y+28, 4,10)
map(0,0, x+92,y+28, 4,10)
end
function make_window(x, y)
local w = {}
w.x = x
w.y = y
w.vx = 0
w.vy = -4
w.class= "window"
return w
end
function make_windy()
local w = {}
w.idle = 36
w.force = 37
w.force2 = 53
w.x=68
w.y=92
w.vx = 0
w.vy = 0
local target = {}
target.x = 0
target.y = 0
w.target = target
w.jumped = false
w.using_force = false
w.class= "windy"
return w
end
function draw_actor(a)
if(a.jumped)then
spr(52, a.x, a.y)
return
end
if(not a.using_force)then
spr(a.idle, a.x, a.y)
else
if(sin((frame % 5) / 5) > 0)then
spr(a.force, a.x, a.y)
else
spr(a.force2, a.x, a.y)
end
if(ripple_radius > ripple_max_radius-5)then
draw_ripple(a.x+3, a.y+5, ripple_max_radius - ripple_radius-1)
draw_ripple(a.x+3, a.y+5, ripple_max_radius - ripple_radius)
end
draw_ripple(a.x+3, a.y+5, ripple_radius-1)
draw_ripple(a.x+3, a.y+5, ripple_radius)
end
end
function jump(a)
if(not a.jumped)then
a.jumped = true
a.vx = - 2
a.vy = - 2
end
end
--
-- move functions
--
function ease_to(a, target, ease)
dx = a.x - target.x
dy = a.y - target.y
a.vx = dx * ease
a.vy = dy * ease
a.x += a.vx
a.y += a.vy
if(abs(dx) < 0.1 and abs(dy) < 0.1)then
a.x = target.x
a.y = target.y
return false
end
return true
end
function move_actor(a)
if(a.jumped)then
a.x += a.vx
a.y += a.vy
a.vx *= friction
a.vy *= friction
a.vy += gravity
if(a.class == "window" and a.y < 30)then
a.y = 256
end
end
return false
end
function move_stick(s)
dx = s.p1.x - s.p0.x
dy = s.p1.y - s.p0.y
dist = sqrt(dx*dx+dy*dy)
diff = s.length - dist
if(s.horizontal)then
if(diff > resist_x)then
for i=1,count(s.triangles) do
del(triangles,triangles[s.triangles[i]])
end
del(s.p0.sticks,s)
del(s.p1.sticks,s)
del(sticks,s)
end
else
if(diff > resist_y)then
for i=1,count(s.triangles) do
del(triangles,triangles[s.triangles[i]])
end
del(s.p0.sticks,s)
del(s.p1.sticks,s)
del(sticks,s)
end
end
percent = diff/dist/2
offsetx = dx*percent
offsety = dy*percent
if(s.p0.fixed)then
s.p1.x += 2*offsetx
s.p1.y += 2*offsety
else
if(s.p1.fixed)then
s.p0.x -= 2*offsetx
s.p0.y -= 2*offsety
else
s.p0.x -= offsetx
s.p0.y -= offsety
s.p1.x += offsetx
s.p1.y += offsety
end
end
end
-- recalculate point positions
function move_point(p)
if(p.controllable)then
p.x += csx
p.y += csy
end
if(p.fixed)then
return false
end
if(count(p.sticks) == 0)then
del(points,p)
return
end
p.vx = (p.x - p.oldx) * friction
p.vy = (p.y - p.oldy) * friction
p.oldx = p.x
p.oldy = p.y
p.x += p.vx
p.y += p.vy
p.y += gravity
local wind_dice = rnd(1)
if(wind_dice < wind_hit_chance)then
p.x += wind_x
p.y += wind_y
end
if(p.x > 228)then
p.x = 228
p.oldx = p.x + p.vx * bounce
end
if(p.x < -100)then
p.x = 0
p.oldx = p.x + p.vx * bounce
end
if(p.y > 228)then
p.y = 228
p.oldy = p.y + p.vy * bounce
end
if(p.y < 0)then
p.y = 0
p.oldy = p.y + p.vy * bounce
end
end
function _update()
frame += 1
if(cam.vy~= 0 or cam.vx ~= 0)then
cam.y += cam.vy
cam.x += cam.vx
end
if(sent_f)then
end
if(wind_x > wind_max_x)then
wind_x = wind_max_x
elseif(wind_x < -wind_max_x)then
wind_x = -wind_max_x
end
if(wind_y > wind_max_y)then
wind_y = wind_max_y
elseif(wind_y < -wind_max_y)then
wind_y = -wind_max_y
end
local wind_str = abs(wind_x) + abs(wind_y)
if(wind_str < 2 )then
sfx(5,1)
elseif(wind_str < 4)then
sfx(1,1)
elseif(wind_str < 5)then
sfx(2,1)
elseif(wind_str < 6)then
sfx(3,1)
else
sfx(4,1)
end
move_clouds(cloud_circles_fg)
move_clouds(cloud_circles)
foreach(points, move_point)
foreach(sticks, move_stick)
move_actor(windy)
move_actor(window)
move_actor(window2)
csx = 0 csy = 0
if (btn(0,1)) then x-=sx csx-=sx end
if (btn(1,1)) then x+=sx csx+=sx end
if (btn(2,1)) then y-=sy csy-=sy end
if (btn(3,1)) then y+=sy csy+=sy end
windy.using_force = false
if (btn(0,0)) then wind_x-=wind_control_strength windy.using_force = true end
if (btn(1,0)) then wind_x+=wind_control_strength windy.using_force = true end
if (btn(2,0)) then wind_y-=wind_control_strength windy.using_force = true end
if (btn(3,0)) then wind_y+=wind_control_strength windy.using_force = true end
if (btn(4,0) and btn(5,0)) then did_jump = true jump(windy) end
ripple_radius += ripple_speed
if(ripple_radius > ripple_max_radius)then
ripple_radius = 0
end
end
function _draw()
draw_scene()
draw_actor(windy)
draw_window(window.x,window.y)
draw_window(window2.x,window2.y)
print("points:" .. count(points), 0, 0, 2)
print("sticks:" .. count(sticks), 0, 7, 2)
print("cpu:" .. stat(1)*100 .. "%" , 1, 14, 2)
if(cam.vy ~= 0 or cam.vx ~= 0)then
if(cam.y <= 256)then
camera(cam.x, cam.y)
end
end
if(windy.jumped)then
if(not sent_f)then
stop_f = frame + 1
sent_f = true
end
if(sent_f and frame > stop_f)then
start_camera_movement()
else
print("press z+x to jump", 51, 120, 7)
end
else
if(frame > 50)then
print("press z+x to jump", 51, 120, 0)
elseif(frame > 45)then
print("press z+x to jump", 51, 120, 1)
end
end
foreach(triangles, draw_triangle)
foreach(sticks, draw_stick)
if(not skip_draw_particles)then
foreach(points, draw_particle)
end
end
sent_f = false
-- http://webstaff.itn.liu.se/~stegu/circle/circlealgorithm.pdf
function draw_ripple(x0,y0,radius)
local x = radius
local y = 0
decisionOver2 = 1 - x
while( y <= x )do
pset( x + x0, y + y0, pget( x + x0 + 1, y + y0 +1))
--pset( y + x0, x + y0)
pset(-x + x0, y + y0, pget( -x + x0 -1, y + y0 +1))
--pset(-y + x0, x + y0)
pset(-x + x0, -y + y0, pget(-x + x0 -1, -y + y0 -1))
--pset(-y + x0, -x + y0)
pset( x + x0, -y + y0, pget(x + x0 +1, -y + y0 -1))
--pset( y + x0, -x + y0)
y += 1
if(decisionOver2 <= 0)then
decisionOver2 += 1 * y + 1
else
x -= 1
decisionOver2 += 1 * (y - x) + 1
end
end
end
function start_camera_movement()
cam.vy = 4
end
-- called at start by pico-8
function _init()
cam = {}
cam.vx = 0
cam.vy = 0
cam.x = 0
cam.y = 0
lastpnt = {}
windy = make_windy()
window = make_window(0,128)
window2 = make_window(0,256)
ripple_radius = 3
ripple_speed = 1
pi = 3.1416
make_clouds(cloud_circles, {6,15,7,20}, 15)
make_clouds(cloud_circles_fg, {3,12,6,7,4,10,12}, 13)
local spacing_x = 7
local spacing_y = 7
cols = 5
rows = 8
-- fixes 0 index
cols += 1
rows += 1
for c=1,cols do
for r=1,rows do
if( (r == 1) )then
pnt = particle(x+ c*spacing_x, y+r*spacing_y,true,true)
elseif( r==8 )then
pnt = particle(x+c*spacing_x,y+r*spacing_y,false,false)
else
pnt = particle(x+c*spacing_x,y+r*spacing_y)
end
if (count(points) < max_points) then
add(points, pnt)
end
local tri_size = 2
local tri_size_minus = tri_size - 1
local p1 = points[((c-tri_size)*(rows))+r-tri_size_minus]
local p2 = points[((c-1)*(rows))+r-tri_size_minus]
local p3 = points[((c-1)*(rows))+r]
local p4 = points[((c-tri_size)*(rows))+r]
if(c>tri_size_minus and r>tri_size_minus)then
if(c%tri_size_minus ==0 and r%tri_size_minus ==0)then
if(c%2==0)then
fabric_color = fc1
end
t342 = make_triangle(p3, p4, p2, false, fabric_color )-- remove if 3 to 4 breaks or 3 to 2 breaks
t124 = make_triangle(p1, p2, p4, true, fabric_color )-- remove if 1 to 2 breaks or 1 to 4 breaks
add(triangles, t342)
add(triangles, t124)
end
end
local tris = {count(triangles)-1,count(triangles)}
-- connect horizontally
if(c>1)then
make_stick(p3,p4, true, tris, c)
end
fabric_color = fc1
-- connect vertically
if(r>1)then
make_stick(p2,p3, false, tris, r)
end
end
end
cp = count(points)
end
__gfx__
fffffffffffffffffff4444050505000000000000000000000000000000000000000000000000000000000000000000000000000000055550000000000000000
44444444444444444445554005050500000000000000000000000000000000000000000000000000000000000000000000000000000055550000000000000000
44444444444444444445554000505000000000000000000000000000000000000000000000000000000000000000000000000000000055550000000000000000
44555555445555555445554000050500555555555555555555555555555555555555555555555555555050500000000000000000000055550000000000000000
44550000445500000445554000005000055555555555555555555555555555555555555555555555550505050000000000000000000055550000000000000000
44550000445500000445554000000500555555555555555555555555555555555555555555555555550050500000000000000000000055550000000000000000
44550000445500000445554000000000055555555555555555555555555555555555555555555555550005050000055555555555555555550000000000000000
44550000445500000445554000000000555555555555555555555555555555555555555555555555550000500000055555555555555555550000000000000000
44550000445500000445554000000000055555555555555555555555555555555555555555555555550000050000055555555555000555550000000000000000
44550000445500000445554000000000555555555555555555555555555555555555555555555555550000000000055555555555000555550000000000000000
44550000445500000445554000000000055555555555555555555555555555555555555555555555550000000000055555555555000555550000000000000000
44550000445500000445554000000000000000000000000000000000000000000000000000000000000000000000055555555555000555550000000000000000
44550000445500000445554000000000550000000000000000000000000000000000000000000000000000000000055555555555000555550000000000000000
44550000445500000445554000000000555500000000000000000000000000000000000000000000000000000000055555555555000555550000000000000000
44550000445500000445554000000000555555000000000000000000000000000000000000000000000000000000055555555555000555550000000000000000
44550000445500000445554000000000555555550000000000000000000000000000000000000000000000000000055555555555000555550000000000000000
44550000445500000445554000000000700007000000000500000000000000000000000000000000000000000000000055555555555555550000000000000000
445500004455000004455540000000007799ff507000070500000000000000000000000000000000000000000000000055555555055555550000000000000000
44550000445500000445554000000000cf7fcf077799ff0700000000000000000000000000000000000000000000000055555555005555550000000000000000
445555554455555554455540000000009f7ff905af7faf5500000000000000000000000000000000000000000000000055555555000555550000000000000000
44ffffff44fffffff445554000000000777777579f7fff7700000000000000000000000000000000000000000000000055555555000555550000000000000000
44444444444444444445554000000000007777777777777700000000000000000000000000000000000000000000000055555555000555550000000000000000
44444444444444444445554000000000005055050057550500000000000000000000000000000000000000000000000055555555000555550000000000000000
44444444444444444444444000000000007077070070770700000000000000000000000000000000000000000000000055555555000555550000000000000000
000000000000000000000000000000007799ff700000000500000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000cf7fcf000700007500000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000009f7ff90507799ff700000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000777777070af7faf500000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000575750509f7fff700000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000706777700777777700000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000775750057550500000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000770070770700000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000007077070000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000