forked from hackclub/sprig
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrash_IT.js
776 lines (749 loc) · 14.7 KB
/
Trash_IT.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
/*
@title: Trash_IT
@author: N Rizwan
*/
/*
Hey there guys!
Objective : Delete the File
> Put the Folder into the Trash
> Avoid the 💀 FOR YOUR OWN SAFETY!
> Press L for MAGIK
> Press K for Music
> As you progress, it will be more confusing 😏
*/
//===================VARIABLES=====================
const player = "p";
const w = "w";
const w1 = "r";
const w2 = "s";
const w3 = "f";
const w4 = "q";
const w5 = "t";
const w6 = "y";
const w7 = "u";
const folder = "d";
const dustbin = "k";
const skull = "l";
const power = "o";
const poweroff = "g";
const black = "h";
const back = "b";
const box = "M";
const portal = "P";
const fake = "F";
const T = "T";
const H = "H";
const E = "E";
const N = "N";
const D = "D";
const I = "I";
const C = "C";
const s = tune`
166.66666666666666,
166.66666666666666: f5^166.66666666666666,
5000`;
const wa = tune`
166.66666666666666,
166.66666666666666: d5^166.66666666666666,
5000`;
const a = tune`
166.66666666666666,
166.66666666666666: a5^166.66666666666666,
5000`;
const d = tune`
166.66666666666666,
166.66666666666666: d5^166.66666666666666,
5000`;
const music = tune`
428.57142857142856: g4~428.57142857142856,
428.57142857142856: g4~428.57142857142856 + c5-428.57142857142856,
428.57142857142856: b4~428.57142857142856 + c5-428.57142857142856,
428.57142857142856: b4~428.57142857142856,
428.57142857142856: d5^428.57142857142856,
428.57142857142856: c5~428.57142857142856 + d5^428.57142857142856,
428.57142857142856: c5~428.57142857142856,
428.57142857142856: c5~428.57142857142856 + e5~428.57142857142856,
428.57142857142856: e5~428.57142857142856,
428.57142857142856: e5~428.57142857142856 + f5^428.57142857142856,
428.57142857142856: e5~428.57142857142856 + f5^428.57142857142856,
428.57142857142856: e5~428.57142857142856,
428.57142857142856: e5~428.57142857142856,
428.57142857142856: e5~428.57142857142856 + f5~428.57142857142856 + a5^428.57142857142856,
428.57142857142856: a5^428.57142857142856 + f4^428.57142857142856 + g4^428.57142857142856,
428.57142857142856: a5^428.57142857142856 + g4^428.57142857142856 + e5^428.57142857142856,
428.57142857142856: g4^428.57142857142856 + e5^428.57142857142856,
428.57142857142856: g4^428.57142857142856 + e5^428.57142857142856,
428.57142857142856: g4^428.57142857142856 + f5^428.57142857142856,
428.57142857142856: g4^428.57142857142856 + a4^428.57142857142856 + g5^428.57142857142856 + f5^428.57142857142856,
428.57142857142856: a4^428.57142857142856 + a5^428.57142857142856,
428.57142857142856: c5-428.57142857142856 + d5-428.57142857142856,
428.57142857142856: d5-428.57142857142856,
428.57142857142856: d5-428.57142857142856 + f4~428.57142857142856 + f5^428.57142857142856,
428.57142857142856: d5-428.57142857142856 + e5-428.57142857142856 + f4~428.57142857142856,
428.57142857142856: e5-428.57142857142856 + g4~428.57142857142856,
428.57142857142856: a4~428.57142857142856,
428.57142857142856: c5~428.57142857142856 + b4~428.57142857142856 + g5^428.57142857142856,
428.57142857142856: d5~428.57142857142856 + a5^428.57142857142856,
428.57142857142856: e5~428.57142857142856 + b5^428.57142857142856 + a5^428.57142857142856 + d4^428.57142857142856,
428.57142857142856: f5~428.57142857142856 + d4^428.57142857142856,
428.57142857142856: d4^428.57142857142856 + c4^428.57142857142856`;
//==============BITMAPS===================
setLegend(
[ player, bitmap`
................
..00.....000....
.0220..001220...
.0222001201220..
.0122220122220..
..012222222L220.
...012222L22L20.
...0012222L2220.
...0LL122222220.
...0L11222222020
....011222222220
.....0111102210.
......00001210..
........0L110...
........0LL0....
.........00.....`],
[ w, bitmap`
0000000000000000
1111111111111111
1111111111111111
0000000000000000
2222222222222222
2222222222222222
2222222222222222
2222222222222222
2222222222222222
2222222222222222
2222222222222222
2222222222222222
2222222222222222
2222222222222222
2222222222222222
2222222222222222`],
[ w1, bitmap`
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222`],
[ w2, bitmap`
2222222222222222
2222222222222222
2222222222222222
2222222222222222
2222222222222222
2222222222222222
2222222222222222
2222222222222222
2222222222222222
2222222222222222
2222222222222222
2222222222222222
0000000000000000
1111111111111111
1111111111111111
0000000000000000`],
[ w3, bitmap`
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222220110`],
[ w4, bitmap`
2222200000000000
2222001111111111
2220011111111111
2200111000000000
2001110022222222
0011100222222222
0111002222222222
0110022222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222`],
[ w5, bitmap`
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110222222222222
0110022222222222
0111002222222222
0011100222222222
2001110022222222
2200111000000000
2220011111111111
2222001111111111
2222200000000000`],
[ w6, bitmap`
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222200110
2222222222001110
2222222220011100
2222222200111002
0000000001110022
1111111111100222
1111111111002222
0000000000022222`],
[ w7, bitmap`
0000000000222222
1111111110022222
1111111111002222
0000000011100222
2222222001110022
2222222200111002
2222222220011100
2222222222001110
2222222222200110
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222220110
2222222222220110`],
[ folder, bitmap`
................
................
...0000000......
..022222220000..
.02666666622220.
0266666000000000
0266660222222260
0200002666666660
0202226666666660
0202666666666660
0202666666666660
0202666666666660
0602666666666660
0602666666666660
.06666666666660.
..000000000000..`],
[ dustbin, bitmap`
......0000......
....000.L000....
...0.....LLL0...
..0...11.....0..
..011111111110..
...0.11.11.10...
...0.11.11.10...
...0.11.11.10...
...0.11.11.10...
...0.11.11.10...
...0.11.11.10...
...0.LL.LL.L0...
...0........0...
...01......10...
....00000000....
................`],
[ skull, bitmap`
................
...0000000000...
..002222222200..
.00222222222200.
.02222222222220.
.02222222222220.
.00002220000220.
.00002220000220.
.000220200022.0.
.02222222222000.
.02222222220000.
.0022222200000..
..02022020000...
..0000000000....
................
................`],
[ fake, bitmap`
................
...3333333333...
..332222222233..
.33222222222233.
.32222222222223.
.32222222222223.
.33332223333223.
.33332223333223.
.33322323332223.
.32222222222333.
.32222222223333.
.3322222233333..
..32322323333...
..3333333333....
................
................`],
[ power, bitmap`
2333333333333332
3333333223333333
3333333223333333
3333223223223333
3332223223222333
3332233223322333
3322333223332233
3322333333332233
3322333333332233
3312233333322333
3312223333222333
3331222222221333
3333112222113333
3333311111133333
3333333333333333
2333333333333332`],
[ poweroff, bitmap`
2444444444444442
4444444444444444
4444444442222444
4444224442224444
4442224442222444
4442244442122244
4422444444412244
4422444444412244
4422444444412244
4412244444122L44
4412224444222L44
444122222222L444
4444112222LL4444
4444411111L44444
4444444444444444
2444444444444442`],
[ back, bitmap`
2222000000002222
2200222222220022
2022220222222202
2022200222222202
0222000222222220
0220000000222220
0200000000002220
0220000000000220
0222000220000220
0222200222000220
0222220222000220
0222222222000220
2022222222202202
2022222222222202
2200222222220022
2222000000002222`],
[black, bitmap`
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000`],
[box, bitmap`
2222222222222222
2002222222000222
0550222222052022
0551000000155202
0551LL2222155520
0551LL2L22155520
0551LL2222155520
0555111111555520
0555555555555520
0555111111155520
0551666666615520
0551611166615520
0551666666615520
0351611111615320
0551LLLLLLL15520
2000000000000002`],
[portal, bitmap`
................
................
.....0000000....
....00LLLLL0....
...00LL000000...
...0L00828880...
..00L02228880...
..01L028888880..
..010288888880..
..010288888280..
.0110888888280..
.0108888888880..
.0108888888880..
.01088888828800.
001088882228880.
010888888888880.`],
[T, bitmap`
................
..111111111111..
.1100000000000..
.1000000000000..
......100.......
......100.......
......100.......
......100.......
......100.......
......100.......
......100.......
......100.......
......100.......
......100.......
......100.......
......100.......`],
[H, bitmap`
................
..11........11..
.110.......110..
.100.......100..
.100.......100..
.100.......100..
.100.......100..
.100.......100..
.1001111111100..
.1000000000000..
.1000000000000..
.100.......100..
.100.......100..
.100.......100..
.100.......100..
.100.......100..`],
[E, bitmap`
................
..111111111111..
.1100000000000..
.1000000000000..
.100............
.100............
.100............
.100............
.1001111111111..
.1000000000000..
.1000000000000..
.100............
.100............
.1001111111111..
.1000000000000..
.1000000000000..`],
[N, bitmap`
................
..11........11..
.1100......110..
.10000.....100..
.10000.....100..
.100000....100..
.1001000...100..
.1001100...100..
.100.1100..100..
.100..100..100..
.100..1100.100..
.100...100.100..
.100...1100100..
.100....110000..
.100.....10000..
.100.....11000..`],
[D, bitmap`
................
..1111..........
.110000.........
.1000000000.....
.100110000000...
.100..1110000...
.100.....11000..
.100.......100..
.100.......1100.
.100.......1100.
.100.......1100.
.100.......1100.
.100......11000.
.100..11110000..
.100000000000...
.100000000......`],
[I, bitmap`
................
..111111111111..
.1100000000000..
.1000000000000..
......100.......
......100.......
......100.......
......100.......
......100.......
......100.......
......100.......
......100.......
......100.......
...111100.......
..110000000000..
..100000000000..`],
[C, bitmap`
................
................
....111111......
...1100000......
...1000000......
....10000.......
....10000.......
....10000.......
....1100........
.....100........
.....100........
.....100........
................
.....100........
.....100........
................`],
);
//====================LEVELS=========================
let level = 0;
const levels = [
map`
qwwwwwwwwwwwu
r...........f
r.d.........f
r..NED.HICl.f
r...........f
r...........f
rp.........kf
tsssssssssssy`, //MAIN PAGE
map`
qwwwwwwwwwwwu
rM...M..hh..f
rhhhlh......f
r....h.hdhM.f
r.h.Mh.M....f
r.hh.....hh.f
rph.......hkf
tsssssssssssy`, //Level 1
map`
qwwwwwwwwwwwu
r.....Ml....f
r....hhhh.d.f
r...hhh..Mh.f
r.M.h.M.....f
r.h.M...hhh.f
rph...M....kf
tsssssssssssy`, //Level 2
map`
qwwwwwwwwwwwu
r..M....M...f
r..h..hh....f
r..M.h..MhM.f
r.h..h...h..f
rkhdM.hhlh.Mf
rph........hf
tsssssssssssy`, //Level 3
map`
qwwwwwwwwwwwu
r.hhh...hhh.f
rh....M...lhf
r.M..MkM....f
r.h...h...d.f
r..hh...hh.hf
rp....M..M..f
tsssssssssssy`, //Level 4
map`
qwwwwwwwwwwwu
rM....M....Mf
rh.M..h..M.hf
r..h.hkh.h..f
r...hl.lh...f
rh.M..d..M.hf
rp..h.M.h.hof
tsssssssssssy`, //Level 5
map`
qwwwwwwwwwwwu
rk......M.l.f
rhhhhM......f
r.......h...f
r.M..hlh.Mdhf
rhhhM....h..f
rp....M....lf
tsssssssssssy`, //Level 6
map`
qwwwwwwwwwwwu
rh..M...h..hf
r...h...d...f
rMM.hhhhh...f
r...M.h..MMMf
r..M..l.....f
rpMh..k...h.f
tsssssssssssy`, //Level 7
map`
qwwwwwwwwwwwu
r.l.M......Mf
rh..hhhhl.M.f
rh.llh.lpl..f
r..M.lh.M.h.f
r.hl.Mh...hdf
rh.M..M...hkf
tsssssssssssy`, //Level 8
map`
qwwwwwwwwwwwu
rlllllllllllf
rlllllllllllf
rMlllllllllMf
rMlllllllllMf
rMlllllllllMf
rpd...F....kf
tsssssssssssy`, //Level 9
map`
qwwwwwwwwwwwu
r.g.......o.f
r...M..F..M.f
r.M...PM....f
rhhhhhhhhhhhf
r...ll...ll.f
rp..llM.dllkf
tsssssssssssy`, //Level 10
map`
qwwwwwwwwwwwu
rhhl.h.M....f
rh...h.hhhM.f
r.dM.h......f
r......M.h..f
r.hhh..Mh.h.f
rp....h..lhkf
tsssssssssssy`, //Level 11
map`
qwwwwwwwwwwwu
r.M..h..hhhhf
r.F..h..h...f
r.h.....h.M.f
r.lMd.h...hMf
r.h.....M...f
rph...M....kf
tsssssssssssy`, //Level 12
map`
qwwwwwwwwwwwu
rh....M..h..f
rF.M.....M..f
rh.h.....hF.f
rh.hM.M..h..f
rh.hhFh.h.dlf
rpkh..h.....f
tsssssssssssy`, //Level 13
map`
qwwwwwwwwwwwu
rFFFFFFFFFFFf
rFFFFFFFFFFFf
rFFFFFFFFFFFf
rFFFFFFFFFFFf
rFFFFFFFdFFFf
rp.M......lkf
tsssssssssssy`, //Level 14
map`
qwwwwwwwwwwwu
ro.M.......hf
rhhhhhhhM.Mhf
r......l..h.f
r.h...M.....f
r.h.Mhhhh.d.f
rph.khMh..M.f
tsssssssssssy`, //Level 15
map`
qwwwwwwwwwwwu
r...........f
r...THE.....f
r......ENDC.f
r...........f
r.....l.....f
rp..........f
tsssssssssssy`, //END
];
const currentLevel = levels[level];
setMap(currentLevel);
//==================PROPERTIES===================
setSolids([player,w,w1,w2,w3,w4,w5,w6,w7,black,box,folder,back,poweroff]);
setPushables({
[player]: [box,folder,back,poweroff],
[folder]: [folder],
});
//===============PLAYER INPUT===================
onInput("s", () => {getFirst(player).y += 1
playTune(s);});
onInput("w", () => {getFirst(player).y -= 1
playTune(wa);});
onInput("d", () => {getFirst(player).x += 1
playTune(d);});
onInput("a", () => {getFirst(player).x -= 1
playTune(a);});
//========================================================
afterInput(() => {
//===========FOLDER TO TRASH SCRIPT==============
const dustbins = tilesWith(dustbin).length;
const targett = tilesWith(dustbin, folder).length;
if (dustbins === targett)
{
level = level + 1;
const currentLevel = levels[level];
if (currentLevel !== undefined)
{
setMap(currentLevel);
}
}
//===========MOUSE TO SKULL RESTART SCRIPT==============
const skulls = tilesWith(skull).length;
const target = tilesWith(skull, player).length;
if (skulls === target)
{
let tr = level = 0;
const ds = levels[tr];
if (ds !== undefined)
{
setMap(ds);
}
}
//======================HEADER============================
addText("-Trash IT!-",{ color: color`8` });
addText("-Delete the File-", { y:15, color: color`8` });
//========================================================
});
//============PRESS `l` To go back to MAIN PAGE==================
onInput("l", () => {
const currentLevel = levels[level=0];
clearText();
setMap(currentLevel);
});
onInput("k", () => {
playTune(music, Infinity);
});
//===================================================================================