forked from simonlc/tetr.js
-
Notifications
You must be signed in to change notification settings - Fork 27
/
data.js
980 lines (950 loc) · 32.9 KB
/
data.js
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
/**
* Piece data
*/
// [r][x][y]
var TetroI = [
[[0,1,0,0],[0,1,0,0],[0,1,0,0],[0,1,0,0]],
[[0,0,0,0],[0,0,0,0],[1,1,1,1],[0,0,0,0]],
[[0,0,1,0],[0,0,1,0],[0,0,1,0],[0,0,1,0]],
[[0,0,0,0],[1,1,1,1],[0,0,0,0],[0,0,0,0]]];
var TetroJ = [
[[2,2,0,0],[0,2,0,0],[0,2,0,0],[0,0,0,0]],
[[0,0,0,0],[2,2,2,0],[2,0,0,0],[0,0,0,0]],
[[0,2,0,0],[0,2,0,0],[0,2,2,0],[0,0,0,0]],
[[0,0,2,0],[2,2,2,0],[0,0,0,0],[0,0,0,0]]];
var TetroL = [
[[0,3,0,0],[0,3,0,0],[3,3,0,0],[0,0,0,0]],
[[0,0,0,0],[3,3,3,0],[0,0,3,0],[0,0,0,0]],
[[0,3,3,0],[0,3,0,0],[0,3,0,0],[0,0,0,0]],
[[3,0,0,0],[3,3,3,0],[0,0,0,0],[0,0,0,0]]];
var TetroO = [
[[0,0,0,0],[4,4,0,0],[4,4,0,0],[0,0,0,0]],
[[0,0,0,0],[4,4,0,0],[4,4,0,0],[0,0,0,0]],
[[0,0,0,0],[4,4,0,0],[4,4,0,0],[0,0,0,0]],
[[0,0,0,0],[4,4,0,0],[4,4,0,0],[0,0,0,0]]];
var TetroS = [
[[0,5,0,0],[5,5,0,0],[5,0,0,0],[0,0,0,0]],
[[0,0,0,0],[5,5,0,0],[0,5,5,0],[0,0,0,0]],
[[0,0,5,0],[0,5,5,0],[0,5,0,0],[0,0,0,0]],
[[5,5,0,0],[0,5,5,0],[0,0,0,0],[0,0,0,0]]];
var TetroT = [
[[0,6,0,0],[6,6,0,0],[0,6,0,0],[0,0,0,0]],
[[0,0,0,0],[6,6,6,0],[0,6,0,0],[0,0,0,0]],
[[0,6,0,0],[0,6,6,0],[0,6,0,0],[0,0,0,0]],
[[0,6,0,0],[6,6,6,0],[0,0,0,0],[0,0,0,0]]];
var TetroZ = [
[[7,0,0,0],[7,7,0,0],[0,7,0,0],[0,0,0,0]],
[[0,0,0,0],[0,7,7,0],[7,7,0,0],[0,0,0,0]],
[[0,7,0,0],[0,7,7,0],[0,0,7,0],[0,0,0,0]],
[[0,7,7,0],[7,7,0,0],[0,0,0,0],[0,0,0,0]]];
// [r][MINX MINY MAXX MAXY]
var RectI = [[0,1,4,2],[2,0,3,4],[0,2,4,3],[1,0,2,4]];
var RectJ = [[0,0,3,2],[1,0,3,3],[0,1,3,3],[0,0,2,3]];
var RectL = [[0,0,3,2],[1,0,3,3],[0,1,3,3],[0,0,2,3]];
var RectO = [[1,0,3,2],[1,0,3,2],[1,0,3,2],[1,0,3,2]];
var RectS = [[0,0,3,2],[1,0,3,3],[0,1,3,3],[0,0,2,3]];
var RectT = [[0,0,3,2],[1,0,3,3],[0,1,3,3],[0,0,2,3]];
var RectZ = [[0,0,3,2],[1,0,3,3],[0,1,3,3],[0,0,2,3]];
var WKTableSRSI_R = [
[[ 0, 0],[-2, 0],[+1, 0],[-2,+1],[+1,-2]],
[[ 0, 0],[-1, 0],[+2, 0],[-1,-2],[+2,+1]],
[[ 0, 0],[+2, 0],[-1, 0],[+2,-1],[-1,+2]],
[[ 0, 0],[+1, 0],[-2, 0],[+1,+2],[-2,-1]]];
var WKTableSRSI_L = [
[[ 0, 0],[-1, 0],[+2, 0],[-1,-2],[+2,+1]],
[[ 0, 0],[+2, 0],[-1, 0],[+2,-1],[-1,+2]],
[[ 0, 0],[+1, 0],[-2, 0],[+1,+2],[-2,-1]],
[[ 0, 0],[-2, 0],[+1, 0],[-2,+1],[+1,-2]]];
var WKTableSRSI_2 = [
[[ 0, 0],[-1, 0],[-2, 0],[+1, 0],[+2, 0],[ 0,+1]],
[[ 0, 0],[ 0,+1],[ 0,+2],[ 0,-1],[ 0,-2],[-1, 0]],
[[ 0, 0],[+1, 0],[+2, 0],[-1, 0],[-2, 0],[ 0,-1]],
[[ 0, 0],[ 0,+1],[ 0,+2],[ 0,-1],[ 0,-2],[+1, 0]]];
var WKTableSRSX_R = [
[[ 0, 0],[-1, 0],[-1,-1],[ 0,+2],[-1,+2]],
[[ 0, 0],[+1, 0],[+1,+1],[ 0,-2],[+1,-2]],
[[ 0, 0],[+1, 0],[+1,-1],[ 0,+2],[+1,+2]],
[[ 0, 0],[-1, 0],[-1,+1],[ 0,-2],[-1,-2]]];
var WKTableSRSX_L = [
[[ 0, 0],[+1, 0],[+1,-1],[ 0,+2],[+1,+2]],
[[ 0, 0],[+1, 0],[+1,+1],[ 0,-2],[+1,-2]],
[[ 0, 0],[-1, 0],[-1,-1],[ 0,+2],[-1,+2]],
[[ 0, 0],[-1, 0],[-1,+1],[ 0,-2],[-1,-2]]];
var WKTableSRSX_2 = [
[[ 0, 0],[+1, 0],[+2, 0],[+1,+1],[+2,+1],[-1, 0],[-2, 0],[-1,+1],[-2,+1],[ 0,-1],[+3, 0],[-3, 0]],
[[ 0, 0],[ 0,+1],[ 0,+2],[-1,+1],[-1,+2],[ 0,-1],[ 0,-2],[-1,-1],[-1,-2],[+1, 0],[ 0,+3],[ 0,-3]],
[[ 0, 0],[-1, 0],[-2, 0],[-1,-1],[-2,-1],[+1, 0],[+2, 0],[+1,-1],[+2,-1],[ 0,+1],[-3, 0],[+3, 0]],
[[ 0, 0],[ 0,+1],[ 0,+2],[+1,+1],[+1,+2],[ 0,-1],[ 0,-2],[+1,-1],[+1,-2],[-1, 0],[ 0,+3],[ 0,-3]]];
var WKTableSRSI = [WKTableSRSI_R,WKTableSRSI_L,WKTableSRSI_2];
var WKTableSRSX = [WKTableSRSX_R,WKTableSRSX_L,WKTableSRSX_2];
var WKTableSRS = [WKTableSRSI,WKTableSRSX,WKTableSRSX,WKTableSRSX,WKTableSRSX,WKTableSRSX,WKTableSRSX];
var WKTableCultris = [[ 0, 0],[-1, 0],[+1, 0],[ 0,+1],[-1,+1],[+1,+1],[-2, 0],[+2, 0],[ 0,-1]];
var WKTableDTET_R = [[ 0, 0],[+1, 0],[-1, 0],[ 0,+1],[+1,+1],[-1,+1],[ 0,-1]];
var WKTableDTET_L = [[ 0, 0],[-1, 0],[+1, 0],[ 0,+1],[-1,+1],[+1,+1],[ 0,-1]];
var WKTableDTET = [WKTableDTET_R,WKTableDTET_L,WKTableDTET_L];
var WKTableDX_R = [[[0, 0], [-1, -1]], [[0, 0], [+1, -1]], [[0, 0], [+1, +1]], [[0, 0], [-1, +1]]];
var WKTableDX_L = [[[0, 0], [+1, -1]], [[0, 0], [+1, +1]], [[0, 0], [-1, +1]], [[0, 0], [-1, -1]]];
var WKTableDX_2 = [[[0, 0], [ 0, -2]], [[0, 0], [-2, 0]], [[0, 0], [ 0, +2]], [[0, 0], [+2, 0]]];
var WKTableDX = [WKTableDX_R,WKTableDX_L,WKTableDX_2];
var OffsetSRS = [
[[ 0, 0],[ 0, 0],[ 0, 0],[ 0, 0]],
[[ 0, 0],[ 0, 0],[ 0, 0],[ 0, 0]],
[[ 0, 0],[ 0, 0],[ 0, 0],[ 0, 0]],
[[ 0, 0],[ 0, 0],[ 0, 0],[ 0, 0]],
[[ 0, 0],[ 0, 0],[ 0, 0],[ 0, 0]],
[[ 0, 0],[ 0, 0],[ 0, 0],[ 0, 0]],
[[ 0, 0],[ 0, 0],[ 0, 0],[ 0, 0]]];
var OffsetARS = [
[[ 0, 0],[ 0, 0],[ 0,-1],[+1, 0]],
[[ 0,+1],[ 0, 0],[ 0, 0],[ 0, 0]],
[[ 0,+1],[ 0, 0],[ 0, 0],[ 0, 0]],
[[ 0,+1],[ 0,+1],[ 0,+1],[ 0,+1]],
[[ 0,+1],[-1, 0],[ 0, 0],[ 0, 0]],
[[ 0,+1],[ 0, 0],[ 0, 0],[ 0, 0]],
[[ 0,+1],[ 0, 0],[ 0, 0],[+1, 0]]];
var OffsetDTET = [
[[ 0,+1],[ 0, 0],[ 0, 0],[ 0, 0]],
[[ 0,+2],[ 0,+1],[ 0,+1],[ 0,+1]],
[[ 0,+2],[ 0,+1],[ 0,+1],[ 0,+1]],
[[ 0,+2],[ 0,+2],[ 0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+2],[+1,+1],[+1,+1],[+2,+1]],
[[+1,+1],[+1,+1],[+1,+1],[+1,+1]],
[[+1,+2],[+1,+1],[+1,+1],[+2,+1]]];
var OffsetMS = [
[[ 0, 0],[ 0, 0],[ 0,-1],[+1, 0]],
[[+1, 0],[+1, 0],[+1, 0],[+1, 0]],
[[+1, 0],[+1, 0],[+1, 0],[+1, 0]],
[[ 0,+1],[ 0,+1],[ 0,+1],[ 0,+1]],
[[+1,+1],[ 0,+1],[+1, 0],[+1,+1]],
[[+1, 0],[+1, 0],[+1, 0],[+1, 0]],
[[+1,+1],[ 0,+1],[+1, 0],[+1,+1]]];
var OffsetE60 = [
[[ 0, 0],[ 0, 0],[ 0,-1],[+1, 0]],
[[+1, 0],[+1, 0],[+1, 0],[+1, 0]],
[[+1, 0],[+1, 0],[+1, 0],[+1, 0]],
[[ 0,+1],[ 0,+1],[ 0,+1],[ 0,+1]],
[[+1,+1],[+1, 0],[+1, 0],[+2, 0]],
[[+1, 0],[+1, 0],[+1, 0],[+1, 0]],
[[+1,+1],[+1, 0],[+1, 0],[+2, 0]]];
var Offset5000 = [
[[ 0,+1],[-1, 0],[ 0, 0],[ 0, 0]],
[[ 0, 0],[ 0, 0],[ 0, 0],[ 0, 0]],
[[ 0,+1],[ 0,+1],[ 0,+1],[ 0,+1]],
[[ 0, 0],[ 0, 0],[ 0, 0],[ 0, 0]],
[[ 0, 0],[ 0, 0],[ 0,-1],[+1, 0]],
[[ 0,+1],[-1, 0],[ 0,-1],[+1, 0]],
[[ 0, 0],[ 0, 0],[ 0,-1],[+1, 0]]];
var OffsetPlus = [
[[ 0, 0],[ 0, 0],[ 0,-1],[+1, 0]],
[[+1,+1],[+1, 0],[+1, 0],[+1, 0]],
[[+1,+1],[+1, 0],[+1, 0],[+1, 0]],
[[ 0,+1],[ 0,+1],[ 0,+1],[ 0,+1]],
[[+1,+1],[ 0, 0],[+1, 0],[+1, 0]],
[[+1,+1],[+1, 0],[+1, 0],[+1, 0]],
[[+1,+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1, 0, 2],[+1, 0, 2],[ 0,+1, 0],[+1,+1, 0],[+1, 0, 2],[+1,+1, 0]];
var InitInfoNBlox = [[ 0, 0, 0],[ 0, 0, 2],[ 0, 0, 2],[ 0,+1, 0],[ 0,+1, 0],[ 0, 0, 2],[ 0,+1, 0]];
var InitInfoNintendo = [[ 0, 0, 0],[+1, 0, 2],[+1, 0, 2],[ 0,+1, 0],[+1,+1, 0],[+1, 0, 2],[+1,+1, 0]];
var InitInfoMS = [[ 0, 0, 0],[+1, 0, 2],[+1, 0, 2],[ 0,+1, 0],[+1,+1, 0],[+1, 0, 2],[+1,+1, 0]];
var InitInfoE60 = [[ 0, 0, 0],[+1, 0, 2],[+1, 0, 2],[ 0,+1, 0],[+1,+1, 0],[+1, 0, 2],[+1,+1, 0]];
var InitInfo5000 = [[ 0, 0, 3],[ 0, 0, 1],[+1, 0, 3],[ 0, 0, 0],[ 0, 0, 0],[ 0, -1, 2],[ 0, 0, 0]];
var InitInfoPlus = [[ 0, 0, 0],[+1, 0, 2],[+1, 0, 2],[ 0,+1, 0],[+1,+1, 0],[+1, 0, 2],[+1,+1, 0]];
var InitInfoSHC = [[+1,+1, 0],[+1, 0, 2],[+1, 0, 2],[ 0,+1, 0],[+1,+1, 0],[+1, 0, 2],[+1,+1, 0]];
var InitInfoDX = [[ 0, 0, 0],[ 0, 0, 2],[ 0, 0, 2],[ 0,+1, 0],[ 0,+1, 0],[ 0, 0, 2],[ 0,+1, 0]];
var InitInfoNintendoL = [[ 0, 0, 0],[ 0, 0, 2],[ 0, 0, 2],[ 0,+1, 0],[ 0,+1, 0],[ 0, 0, 2],[ 0,+1, 0]];
var InitInfoQuadra = [[ 0, 0, 0],[ 0, 0, 2],[ 0, 0, 2],[ 0,+1, 0],[ 0,+1, 0],[ 0, 0, 2],[ 0,+1, 0]];
var InitInfoMybo = [[ 0,+1, 0],[+1, 0, 2],[+1, 0, 2],[ 0,+1, 0],[+1,+1, 0],[+1, 0, 2],[+1,+1, 0]];
var InitInfoTNET = [[ 0, 0, 0],[+1, 0, 2],[+1, 0, 2],[ 0,+1, 0],[+1,+1, 0],[+1, 0, 2],[+1,+1, 0]];
var InitInfoCDi = [[+1, 0, 0],[+1, 0, 2],[+1, 0, 2],[ 0,+1, 0],[+1,+1, 0],[+1, 0, 2],[+1,+1, 0]];
var InitInfoMax = [[ 0, 0, 3],[+1, 0, 3],[+1, 0, 1],[ 0,+1, 0],[+1, 0, 3],[+1, 0, 2],[+1, 0, 3]];
var InitInfoIntelore = [[ 0, 0, 0],[ 0, 0, 1],[+1, 0, 3],[ 0,+1, 0],[ 0, 0, 1],[ 0, 0, 1],[ 0, 0, 1]];
var InitInfoZen = [[ 0,-1, 3],[+1, 0, 3],[ 0, 0, 1],[ 0,+1, 0],[ 0, 0, 1],[ 0, 0, 2],[ 0, 0, 1]];
var InitInfoTris = [[ 0, 0, 3],[+1, 0, 3],[ 0, 0, 1],[ 0,+1, 0],[+1,+1, 3],[+1, 0, 2],[+1,+1, 3]];
var InitInfoBPS = [[ 0,+1, 0],[ 0,+1, 0],[ 0,+1, 0],[ 0,+1, 0],[+1,+1, 0],[ 0,+1, 0],[+1,+1, 0]];
var InitInfoBPS2 = [[ 0,+1, 0],[ 0, 0, 2],[ 0, 0, 2],[ 0,+1, 0],[ 0, 0, 2],[ 0, 0, 2],[ 0, 0, 2]];
var InitInfoAcid = [[+1, 0, 0],[+2, 0, 2],[+2, 0, 2],[+2,+1, 0],[+2,+1, 0],[+2, 0, 2],[+2,+1, 0]];
var InitInfoTrukaMy = [[ 0, 0, 0],[+1, 0, 2],[+1, 0, 2],[ 0, 0, 0],[+1, 0, 0],[+1, 0, 2],[+1, 0, 0]];
var InitInfoTwin = [[ 0, 0, 0],[+1,+1, 0],[ 0,+1, 0],[ 0,+1, 0],[+1,+1, 0],[ 0,+1, 0],[+1,+1, 0]];
var InitInfoFun2k = [[ 0, 0, 0],[+1, 0, 0],[+1, 0, 0],[+1, 0, 0],[+1, 0, 0],[+1, 0, 0],[+1, 0, 0]];
var InitInfoBrick = [[ 0, 0, 0],[ 0, 0, 2],[ 0, 0, 2],[ 0,+1, 0],[ 0,+1, 0],[ 0, 0, 2],[ 0,+1, 0]];
var InitInfoHuanle = [[ 0, 0, 0],[ 0, 0, 0],[ 0, 0, 0],[ 0, 0, 0],[ 0,-1, 1],[ 0, 0, 0],[ 0,-1, 1]];
var ColorSRS = [1, 2, 3, 4, 5, 6, 7];
var ColorSega = [7, 2, 3, 4, 6, 1, 5];
var ColorQQ = [7, 1, 3, 4, 5, 6, 2];
var ColorTengen = [7, 3, 6, 2, 5, 4, 1];
var ColorAtari = [7, 4, 6, 2, 1, 5, 3];
var ColorNBlox = [3, 6, 2, 7, 1, 4, 5];
var ColorC2 = [5, 2, 6, 4, 1, 7, 9];
var ColorNintendo = [9, 2, 7, 9, 2, 9, 7];
var ColorMS = [7, 6, 4, 1, 2, 8, 5];
var ColorE60 = [5, 5, 5, 5, 5, 5, 5];
var ColorIBM = [7, 9, 6, 2, 5, 3, 1];
var ColorJJ = [5, 1, 3, 4, 7, 6, 2];
var Color5000 = [7, 6, 8, 4, 5, 1, 2];
var ColorDX = [9, 7, 2, 4, 3, 5, 6];
var ColorMybo = [5, 6, 7, 4, 3, 2, 1];
var ColorQuadra = [5, 4, 6, 3, 1, 2, 7];
var ColorGameBoy = [9, 2, 7, 8, 7, 9, 2];
var ColorTNET = [2, 5, 6, 4, 2, 4, 7];
var ColorCDi = [3, 7, 5, 9, 6, 2, 4];
var ColorSHC = [2, 4, 5, 7, 1, 3, 6];
var ColorMax = [2, 7, 1, 6, 4, 5, 9];
var ColorIntelore = [9, 5, 2, 4, 6, 7, 1];
var ColorZen = [6, 2, 7, 4, 3, 5, 1];
var ColorTris = [3, 7, 5, 6, 2, 1, 4];
var ColorSHMac = [5, 4, 3, 7, 2, 1, 6];
var ColorBPS = [7, 4, 1, 2, 6, 9, 5];
var ColorBPS2 = [7, 1, 3, 4, 6, 2, 5];
var ColorAcid = [4, 6, 1, 5, 7, 2, 3];
var ColorCrazyYXWD = [9, 1, 6, 4, 2, 7, 5];
var ColorTrukaMy = [5, 2, 1, 6, 4, 7, 3];
var ColorTwin = [7, 6, 3, 2, 1, 4, 5];
var ColorFun2k = [1, 7, 4, 3, 6, 2, 5];
var ColorMono = [9, 9, 9, 9, 9, 9, 9];
var ColorHuanle = [1, 2, 5, 7, 6, 4, 3];
var RotSys = [
{
initinfo: InitInfoSRS,
offset: OffsetSRS,
color: ColorSRS,
},
{
initinfo: InitInfoSRS,
offset: OffsetSRS,
color: ColorC2,
},
{
initinfo: InitInfoARS,
offset: OffsetARS,
color: ColorSega,
},
{
initinfo: InitInfoDTET,
offset: OffsetDTET,
color: ColorSega,
},
{
initinfo: InitInfoQQ,
offset: OffsetQQ,
color: ColorQQ,
},
{
initinfo: InitInfoAtari,
offset: OffsetAtari,
color: ColorAtari,
},
{
initinfo: InitInfoAtari,
offset: OffsetAtari,
color: ColorTengen,
},
{
initinfo: InitInfoNBlox,
offset: OffsetNBlox,
color: ColorNBlox,
},
{
initinfo: InitInfoNintendo,
offset: OffsetNintendo,
color: ColorNintendo,
},
{
initinfo: InitInfoMS,
offset: OffsetMS,
color: ColorMS,
},
{
initinfo: InitInfoE60,
offset: OffsetE60,
color: ColorE60,
},
{
initinfo: InitInfoE60,
offset: OffsetE60,
color: ColorIBM,
},
{
initinfo: InitInfoSRS,
offset: OffsetSRS,
color: ColorJJ,
},
{
initinfo: InitInfo5000,
offset: Offset5000,
color: Color5000,
},
{
initinfo: InitInfoPlus,
offset: OffsetPlus,
color: ColorSega,
},
{
initinfo: InitInfoDX,
offset: OffsetDX,
color: ColorDX,
},
{
initinfo: InitInfoNintendoL,
offset: OffsetNintendoL,
color: ColorGameBoy,
},
{
initinfo: InitInfoQuadra,
offset: OffsetQuadra,
color: ColorQuadra,
},
{
initinfo: InitInfoMybo,
offset: OffsetMybo,
color: ColorMybo,
},
{
initinfo: InitInfoTNET,
offset: OffsetTNET,
color: ColorTNET,
},
{
initinfo: InitInfoCDi,
offset: OffsetCDi,
color: ColorCDi,
},
{ // spectrum Holobyte Classic (PC)
initinfo: InitInfoSHC,
offset: OffsetSHC,
color: ColorSHC,
},
{
initinfo: InitInfoMax,
offset: OffsetMax,
color: ColorMax,
},
{ //4 games at puzzle-game-download.com / intelore, interesting rs
initinfo: InitInfoIntelore,
offset: OffsetIntelore,
color: ColorIntelore,
},
{
initinfo: InitInfoZen,
offset: OffsetZen,
color: ColorZen,
},
{
initinfo: InitInfoTris,
offset: OffsetTris,
color: ColorTris,
},
{
initinfo: InitInfoE60,
offset: OffsetE60,
color: ColorSHMac,
},
{
initinfo: InitInfoBPS,
offset: OffsetBPS,
color: ColorBPS,
},
{
initinfo: InitInfoBPS2,
offset: OffsetSRS,
color: ColorBPS2,
},
{ // nintendo R with O 1right plus all pieces 1right
initinfo: InitInfoAcid,
offset: OffsetAcid,
color: ColorAcid,
},
{
initinfo: InitInfoSRS,
offset: OffsetCrazyYXWD,
color: ColorCrazyYXWD,
},
{
initinfo: InitInfoTrukaMy,
offset: OffsetTrukaMy,
color: ColorTrukaMy,
},
{
initinfo: InitInfoTwin,
offset: OffsetTwin,
color: ColorTwin,
},
{
initinfo: InitInfoFun2k,
offset: OffsetFun2k,
color: ColorFun2k,
},
{
initinfo: InitInfoBrick,
offset: OffsetBrick,
color: ColorMono,
},
{
initinfo: InitInfoHuanle,
offset: OffsetHuanle,
color: ColorHuanle,
},
];
// Define shapes and spawns.
var PieceI = {
index: 0,
tetro: TetroI,
rect: RectI
};
var PieceJ = {
index: 1,
tetro: TetroJ,
rect: RectJ
};
var PieceL = {
index: 2,
tetro: TetroL,
rect: RectL
};
var PieceO = {
index: 3,
tetro: TetroO,
rect: RectO
};
var PieceS = {
index: 4,
tetro: TetroS,
rect: RectS
};
var PieceT = {
index: 5,
tetro: TetroT,
rect: RectT
};
var PieceZ = {
index: 6,
tetro: TetroZ,
rect: RectZ
};
var flags = {
hardDrop: 1,
moveRight: 2,
moveLeft: 4,
moveDown: 8,
holdPiece: 16,
rotRight: 32,
rotLeft: 64,
rot180: 128,
moveRight3: 256,
moveLeft3: 512,
};
var cellFlags = {
maskColor: 255,
maskConn: 4096-256,
connRight: 256,
connDown: 512,
connLeft: 1024,
connUp: 2048,
maskIndex: 65536-4096, //index+1. 0 = not specified, don't care
heightIndex: 12,
};
var fourWays = [
{dx:+1,dy:0,connFlag:cellFlags.connRight},
{dx:0,dy:+1,connFlag:cellFlags.connDown},
{dx:-1,dy:0,connFlag:cellFlags.connLeft},
{dx:0,dy:-1,connFlag:cellFlags.connUp}];
var pieceSymmetryIndex = [0, 2, 1, 3, 6, 5, 4];
var pieces = (function(pieces){
for(var pi=0;pi<7;pi++){
for(var ri=0;ri<4;ri++){
var p=pieces[pi].tetro[ri];
for(var x=0;x<4;x++){
for(var y=0;y<4;y++){
if(p[x][y]!==0){
if(x+1<4&&p[x+1][y]!==0){
p[x][y]|=cellFlags.connRight;
}
if(y+1<4&&p[x][y+1]!==0){
p[x][y]|=cellFlags.connDown;
}
if(x>0&&p[x-1][y]!==0){
p[x][y]|=cellFlags.connLeft;
}
if(y>0&&p[x][y-1]!==0){
p[x][y]|=cellFlags.connUp;
}
}
}
}
}
}
return pieces;
})([PieceI, PieceJ, PieceL, PieceO, PieceS, PieceT, PieceZ]);
// Finesse data
// index x orientatio x column = finesse
// finesse[0][0][4] = 1
// TODO double check these.
var finesse = [
[
[1, 2, 1, 0, 1, 2, 1],
[2, 2, 2, 2, 1, 1, 2, 2, 2, 2],
[1, 2, 1, 0, 1, 2, 1],
[2, 2, 2, 2, 1, 1, 2, 2, 2, 2]
],
[
[1, 2, 1, 0, 1, 2, 2, 1],
[2, 2, 3, 2, 1, 2, 3, 3, 2],
[2, 3, 2, 1, 2, 3, 3, 2],
[2, 3, 2, 1, 2, 3, 3, 2, 2]
],
[
[1, 2, 1, 0, 1, 2, 2, 1],
[2, 2, 3, 2, 1, 2, 3, 3, 2],
[2, 3, 2, 1, 2, 3, 3, 2],
[2, 3, 2, 1, 2, 3, 3, 2, 2]
],
[
[1, 2, 2, 1, 0, 1, 2, 2, 1],
[1, 2, 2, 1, 0, 1, 2, 2, 1],
[1, 2, 2, 1, 0, 1, 2, 2, 1],
[1, 2, 2, 1, 0, 1, 2, 2, 1]
],
[
[1, 2, 1, 0, 1, 2, 2, 1],
[2, 2, 2, 1, 1, 2, 3, 2, 2],
[1, 2, 1, 0, 1, 2, 2, 1],
[2, 2, 2, 1, 1, 2, 3, 2, 2]
],
[
[1, 2, 1, 0, 1, 2, 2, 1],
[2, 2, 3, 2, 1, 2, 3, 3, 2],
[2, 3, 2, 1, 2, 3, 3, 2],
[2, 3, 2, 1, 2, 3, 3, 2, 2]
],
[
[1, 2, 1, 0, 1, 2, 2, 1],
[2, 2, 2, 1, 1, 2, 3, 2, 2],
[1, 2, 1, 0, 1, 2, 2, 1],
[2, 2, 2, 1, 1, 2, 3, 2, 2]
]
];
/**
* Gameplay specific vars.
*/
var gravityUnit = 1.0/64;
var gravityArr = (function() {
var array = [];
array.push(0);
for (var i = 1; i < 64; i*=2)
array.push(i / 64);
for (var i = 1; i <= 5; i+=1)
array.push(i);
array.push(Infinity);
return array;
})();
var gravityNameArr = (function() {
var array = [];
array.push('0');
for (var i = 1; i < 64; i*=2)
array.push('1/'+(64/i)+' G');
for (var i = 1; i <= 5; i+=1)
array.push(i + 'G');
array.push("20G (∞)")
return array;
})();
var dasNameArr = (function() {
var array = [];
array.push('0');
for (var i = 1; i < 16; i++)
array.push(i+', '+(i>=6?(i/60).toFixed(2)+"s":~~(i*100/6+.5)+"ms"));
return array;
})();
var lockDelayLimit = void 0;
var mySettings = {
DAS: 9,
ARR: 1,
SoftDrop: 7,
Gravity: 0,
LockDelay: 30,
RotSys: 0,
Next: 6,
Size: 0,
Sound: 2,
Volume: 50,
Block: 2,
Ghost: 1,
Grid: 1,
Outline: 1,
DASCut: 0,
NextSide: 0
};
var settings = mySettings; // initialized by reference; replaced when game starts and replay
var settingName = {
DAS: "DAS 加速延迟",
ARR: "ARR 重复速率",
SoftDrop: "Soft Drop 软降速度",
Gravity: "Gravity 下落速度",
LockDelay: "Lock Delay 锁定延迟",
RotSys: "Rotation 旋转系统",
Next: "Next 预览块数",
Size: "Size 大小",
Sound: "Sound 声音",
Volume: "Volume 音量",
Block: "Block 样式",
Ghost: "Ghost 影子",
Grid: "Grid 网格",
Outline: "Outline 方块边缘",
DASCut: "DAS Cut 加速打断",
NextSide: "Next Side 预览位置"
};
var setting = {
DAS: dasNameArr,
ARR: ["0 (∞)","1, 60Hz","2, 30Hz","3, 20Hz","4, 15Hz","5, 12Hz","6, 10Hz","7, 8.6Hz","8, 7.5Hz","9, 6.7Hz","10, 6Hz"],
SoftDrop: gravityNameArr,
Gravity: ["Auto"].concat(gravityNameArr),
LockDelay: range(0, 101),
RotSys: [
'- Super -', 'CultrisII', 'Arika*', 'DTET', 'NM/QQ', 'Atari', 'Tengen',
'N-Blox', 'Nintendo', 'Microsoft', 'E-60', 'IBM PC', 'JJ', '5000',
'Plus', 'DX', 'GameBoy', 'Quadra', 'Mybo', 'TNET', 'CD-i',
'SH Clsc.', 'Max/BL', 'Intelore', 'Zen', 'Tris', 'Quinn', 'BPS', 'BPS2',
'ACiD', '英雄无敌', 'Truka·My', 'Twin', 'TFun2k', 'Brick', '桃谷欢乐'
],
Next: ['-', '1', '2', '3', '4', '5', '6'],
Size: ['Auto', 'Small', 'Medium', 'Large', 'Larger'],
Sound: ['Off', 'Memes', 'Dr.Ocelot'],
Volume: range(0, 101),
Block: ['Shaded', 'Solid', 'Glossy', 'Arika', 'World'],
Ghost: ['Grey', 'Colored', 'Off', 'Hidden'],
Grid: ['Off', 'On'],
Outline: ['Off', 'On', 'Hidden', 'Only'],
DASCut: ['Off', 'On'],
NextSide: ['Right', 'Left']
};
var arrRowGen = {
'simple':
function(arr,offset,range,width) {
var holex = ~~(rng.next()*range)+offset;
for(var x = 0; x < width; x++){
arr[holex + x] = 0;
}
},
'simplemessy':
function(arr,ratio) {
var hashole = false;
for(var x = 0; x < stack.width; x++){
if(rng.next()>=ratio) {
hashole=true;
arr[x] = 0;
}
}
if(hashole===false){
arr[~~(rng.next()*10)] = 0;
}
},
};
var arrStages = [
{begin: 0, delay: 60*5, gen:function(arr){arrRowGen.simple(arr,0,7,4)}},
{begin: 5, delay: 60*7, gen:function(arr){arrRowGen.simple(arr,0,7,4)}},
{begin: 20, delay: 60*5, gen:function(arr){arrRowGen.simple(arr,0,7,4)}},
{begin: 40, delay: 60*4, gen:function(arr){arrRowGen.simple(arr,2,3,4)}},
{begin: 50, delay: 60*2, gen:function(arr){arrRowGen.simple(arr,4,1,2)}},
{begin: 70, delay: 60*5, gen:function(arr){arrRowGen.simple(arr,0,9,2)}},
{begin: 80, delay: 60*4, gen:function(arr){arrRowGen.simple(arr,0,9,2)}},
{begin: 90, delay: 60*3, gen:function(arr){arrRowGen.simple(arr,0,9,2)}},
{begin: 100, delay: 60*4, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin: 120, delay: 60*3.5, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin: 150, delay: 60*4, gen:function(arr){arrRowGen.simple(arr,0,7,4)}},
{begin: 170, delay: 60*3.5, gen:function(arr){arrRowGen.simple(arr,0,7,4)}},
{begin: 200, delay: 60*3.5, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin: 220, delay: 60*3, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin: 250, delay: 60*2.5, gen:function(arr){arrRowGen.simple(arr,0,9,2)}},
{begin: 300, delay: 60*3.5, gen:function(arr){arrRowGen.simplemessy(arr,0.9)}},
{begin: 320, delay: 60*3, gen:function(arr){arrRowGen.simplemessy(arr,0.9)}},
{begin: 350, delay: 60*3.5, gen:function(arr){arrRowGen.simplemessy(arr,0.8)}},
{begin: 390, delay: 60*3, gen:function(arr){arrRowGen.simplemessy(arr,0.8)}},
{begin: 400, delay: 60*4, gen:function(arr){arrRowGen.simplemessy(arr,0.6)}},
{begin: 430, delay: 60*5, gen:function(arr){arrRowGen.simplemessy(arr,0.4)}},
{begin: 450, delay: 60*7, gen:function(arr){arrRowGen.simplemessy(arr,0.1)}},
{begin: 470, delay: 60*7, gen:function(arr){arrRowGen.simplemessy(arr,0.4)}},
{begin: 500, delay: 60*3, gen:function(arr){arrRowGen.simplemessy(arr,0.8)}},
{begin: 550, delay: 60*2.5, gen:function(arr){arrRowGen.simplemessy(arr,0.8)}},
{begin: 600, delay: 60*3, gen:function(arr){arrRowGen.simplemessy(arr,0.6)}},
{begin: 650, delay: 60*2.5, gen:function(arr){arrRowGen.simplemessy(arr,0.6)}},
{begin: 700, delay: 60*3.5, gen:function(arr){arrRowGen.simplemessy(arr,0.4)}},
{begin: 750, delay: 60*3, gen:function(arr){arrRowGen.simplemessy(arr,0.4)}},
{begin: 780, delay: 60*2.5, gen:function(arr){arrRowGen.simplemessy(arr,0.4)}},
{begin: 800, delay: 60*2, gen:function(arr){arrRowGen.simplemessy(arr,0.9)}},
{begin: 900, delay: 60*1.75, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin: 950, delay: 60*1.5, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin:1000, delay: 60*5, gen:function(arr){arrRowGen.simplemessy(arr,0.0)}},
{begin:1020, delay: 60*4, gen:function(arr){arrRowGen.simplemessy(arr,0.0)}},
{begin:1050, delay: 60*4, gen:function(arr){arrRowGen.simple(arr,1,1,8)}},
{begin:1100, delay: 60*3, gen:function(arr){arrRowGen.simple(arr,2,1,6)}},
{begin:1150, delay: 60*3, gen:function(arr){arrRowGen.simple(arr,3,1,4)}},
{begin:1200, delay: 60*2, gen:function(arr){arrRowGen.simple(arr,4,1,2)}},
{begin:1210, delay: 60*1.5, gen:function(arr){arrRowGen.simple(arr,4,1,2)}},
{begin:1210, delay: 60*1, gen:function(arr){arrRowGen.simple(arr,4,1,2)}},
{begin:1250, delay: 60*2, gen:function(arr){arrRowGen.simple(arr,9,1,1)}},
{begin:1260, delay: 60*0.5, gen:function(arr){arrRowGen.simple(arr,9,1,1)}},
{begin:1300, delay: 60*3, gen:function(arr){arrRowGen.simplemessy(arr,0.0)}},
{begin:1350, delay: 60*3, gen:function(arr){arrRowGen.simplemessy(arr,0.1)}},
{begin:1400, delay: 60*4, gen:function(arr){arrRowGen.simplemessy(arr,0.15)}},
{begin:1450, delay: 60*4, gen:function(arr){arrRowGen.simplemessy(arr,0.2)}},
{begin:1480, delay: 60*5, gen:function(arr){arrRowGen.simplemessy(arr,0.2)}},
{begin:1500, delay: 60*1.5, gen:function(arr){arrRowGen.simple(arr,0,9,2)}},
{begin:1550, delay: 60*1.4, gen:function(arr){arrRowGen.simple(arr,0,9,2)}},
{begin:1600, delay: 60*1.3, gen:function(arr){arrRowGen.simple(arr,0,9,2)}},
{begin:1650, delay: 60*1.2, gen:function(arr){arrRowGen.simple(arr,0,9,2)}},
{begin:1700, delay: 60*1.3, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin:1800, delay: 60*1.2, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin:1850, delay: 60*1.15, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin:1900, delay: 60*1.1, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin:1950, delay: 60*1.05, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin:2000, delay: 60*1.0, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin:2050, delay: 60*0.95, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin:2100, delay: 60*0.9, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin:2150, delay: 60*0.85, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin:2180, delay: 60*0.8, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin:2190, delay: 60*1.0, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin:2200, delay: 60*0.8, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin:2300, delay: 60*0.75, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin:2400, delay: 60*0.7, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin:2450, delay: 60*0.6, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
{begin:2500, delay: 60*0.5, gen:function(arr){arrRowGen.simple(arr,0,10,1)}},
];
var sprintRanks= [
{t:600, u:"修仙去吧", b:"Zen"},
{t:540, u:"求进9分钟", b:"9 min...?"},
{t:480, u:"求进8分钟", b:"8 min...?"},
{t:420, u:"求进7分钟", b:"7 min...?"},
{t:360, u:"求进6分钟", b:"6 min...?"},
{t:300, u:"求进5分钟", b:"5 min...?"},
{t:240, u:"终于……", b:"Finally..."},
{t:210, u:"<small>你一定是在逗我</small>", b:"Too slow."},
{t:180, u:"渣渣", b:"Well..."},
{t:160, u:"<small>速度速度加快</small>", b:"Go faster."},
{t:140, u:"<small>还能再给力点么</small>", b:"Any more?"},
{t:120, u:"2分钟?", b:"Beat 2 min."},
{t:110, u:"不难嘛", b:"So easy."},
{t:100, u:"新世界", b:"New world."},
{t: 90, u:"超越秒针", b:"1 drop/sec!"},
{t: 80, u:"恭喜入门", b:"Not bad."},
{t: 73, u:"渐入佳境", b:"Going deeper."},
{t: 69, u:"就差10秒", b:"10 sec faster."},
{t: 63, u:"还有几秒", b:"Approaching."},
{t: 60, u:"最后一点", b:"Almost there!"},
{t: 56, u:"1分钟就够了", b:"1-min Sprinter!"},
{t: 53, u:"并不是沙包", b:"<small>No longer rookie.</small>"},
{t: 50, u:"50不是梦", b:"Beat 50."},
{t: 48, u:"每秒2块", b:"2 drops/sec!"},
{t: 45, u:"很能打嘛", b:"u can tetris."},
{t: 42, u:"有点厉害", b:"Interesting."},
{t: 40, u:"于是呢?", b:"So?"},
{t: 38, u:"高手", b:"Good."},
{t: 35, u:"停不下来", b:"Unstoppable."},
{t: 33, u:"触手", b:"Octopus"},
{t: 31, u:"每秒3块", b:"3 drops/sec!"},
{t: 30, u:"别这样", b:"Noooo"},
{t: 29, u:"你赢了", b:"You win."},
{t: 27, u:"这不魔法", b:"Magic."},
{t: 25, u:"闪电", b:"Lightning!"},
{t: 24, u:"每秒4块", b:"4 drops/sec!"},
{t: 23, u:"神兽", b:"Alien."},
{t: 22, u:"神兽他妈", b:"Beats Alien."},
{t: 21, u:"拯救地球", b:"<small>Save the world?</small>"},
{t: 20, u:"你确定?", b:"r u sure?"},
{t: 19, u:"5块每秒", b:"5pps"},
{t: 18, u:"……", b:"..."},
{t: 16.66, u:"…………", b:"......"},
{t: 14.28, u:"6块每秒", b:"6pps"},
{t: 12.50, u:"7块每秒", b:"7pps"},
{t: 11.11, u:"8块每秒", b:"8pps"},
{t: 10.00, u:"9块每秒", b:"9pps"},
{t: 9.00, u:"10块每秒", b:"10pps"},
{t: 0.00, u:"←_←", b:"→_→"},
{t: -1/0, u:"↑_↑", b:"↓_↓"}
];