foxsnakecode 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1547 @@
1
+ {
2
+ "title": "FoxSnakeCode",
3
+ "levels": [
4
+ {
5
+ "id": "hello-fox",
6
+ "title": "Hello, Fox",
7
+ "instructions": "Grep Fox, this is Sudo Snake. Your first order: type `step(100)` and press Run. One floor panel is 100 steps wide.",
8
+ "starterCode": "",
9
+ "scene": {
10
+ "start": {
11
+ "x": 300,
12
+ "y": 250,
13
+ "angle": 0
14
+ },
15
+ "chips": [
16
+ {
17
+ "x": 400,
18
+ "y": 250
19
+ }
20
+ ]
21
+ }
22
+ },
23
+ {
24
+ "id": "long-hall",
25
+ "title": "Long Hall",
26
+ "instructions": "Same order, longer hall. The number inside `step()` says how far to go. Count the floor panels and change it.",
27
+ "starterCode": "step(100)\n",
28
+ "scene": {
29
+ "start": {
30
+ "x": 150,
31
+ "y": 250,
32
+ "angle": 0
33
+ },
34
+ "chips": [
35
+ {
36
+ "x": 550,
37
+ "y": 250
38
+ }
39
+ ],
40
+ "obstacles": [
41
+ {
42
+ "x": 100,
43
+ "y": 100,
44
+ "w": 550,
45
+ "h": 100
46
+ },
47
+ {
48
+ "x": 100,
49
+ "y": 300,
50
+ "w": 550,
51
+ "h": 100
52
+ }
53
+ ]
54
+ }
55
+ },
56
+ {
57
+ "id": "corner",
58
+ "title": "Corner",
59
+ "instructions": "The hall bends. `turn(90)` turns right and `turn(-90)` turns left. Walk to the corner, turn, and keep going.",
60
+ "starterCode": "step(300)\n",
61
+ "scene": {
62
+ "start": {
63
+ "x": 150,
64
+ "y": 350,
65
+ "angle": 0
66
+ },
67
+ "chips": [
68
+ {
69
+ "x": 450,
70
+ "y": 150
71
+ }
72
+ ],
73
+ "obstacles": [
74
+ {
75
+ "x": 100,
76
+ "y": 100,
77
+ "w": 300,
78
+ "h": 200
79
+ }
80
+ ]
81
+ }
82
+ },
83
+ {
84
+ "id": "two-chips",
85
+ "title": "Two Chips",
86
+ "instructions": "Two chips on a Z-shaped path. Your orders run from top to bottom, so put them in the order you want them done.",
87
+ "starterCode": "step(300)\nturn(90)\n",
88
+ "scene": {
89
+ "start": {
90
+ "x": 150,
91
+ "y": 150,
92
+ "angle": 0
93
+ },
94
+ "chips": [
95
+ {
96
+ "x": 450,
97
+ "y": 150
98
+ },
99
+ {
100
+ "x": 650,
101
+ "y": 350
102
+ }
103
+ ],
104
+ "obstacles": [
105
+ {
106
+ "x": 100,
107
+ "y": 200,
108
+ "w": 300,
109
+ "h": 200
110
+ },
111
+ {
112
+ "x": 500,
113
+ "y": 100,
114
+ "w": 200,
115
+ "h": 200
116
+ }
117
+ ]
118
+ }
119
+ },
120
+ {
121
+ "id": "detour",
122
+ "title": "Detour",
123
+ "instructions": "A wall of crates blocks the straight route. Plan a way around it before you run. Going over the top or under the bottom both work.",
124
+ "starterCode": "step(100)\nturn(-90)\n",
125
+ "scene": {
126
+ "start": {
127
+ "x": 150,
128
+ "y": 250,
129
+ "angle": 0
130
+ },
131
+ "chips": [
132
+ {
133
+ "x": 550,
134
+ "y": 250
135
+ }
136
+ ],
137
+ "obstacles": [
138
+ {
139
+ "x": 350,
140
+ "y": 100,
141
+ "w": 100,
142
+ "h": 300
143
+ }
144
+ ]
145
+ }
146
+ },
147
+ {
148
+ "id": "backtrack",
149
+ "title": "Backtrack",
150
+ "instructions": "The first chip is up a dead end. Grab it, then use `turn(180)` to face back the way you came and go on to the second chip.",
151
+ "starterCode": "step(200)\nturn(-90)\nstep(200)\n",
152
+ "scene": {
153
+ "start": {
154
+ "x": 150,
155
+ "y": 350,
156
+ "angle": 0
157
+ },
158
+ "chips": [
159
+ {
160
+ "x": 350,
161
+ "y": 150
162
+ },
163
+ {
164
+ "x": 650,
165
+ "y": 350
166
+ }
167
+ ],
168
+ "obstacles": [
169
+ {
170
+ "x": 100,
171
+ "y": 100,
172
+ "w": 200,
173
+ "h": 200
174
+ },
175
+ {
176
+ "x": 400,
177
+ "y": 100,
178
+ "w": 300,
179
+ "h": 200
180
+ },
181
+ {
182
+ "x": 300,
183
+ "y": 50,
184
+ "w": 100,
185
+ "h": 50
186
+ }
187
+ ]
188
+ }
189
+ },
190
+ {
191
+ "id": "first-bug",
192
+ "title": "First Bug",
193
+ "instructions": "A Sentry Bug is crossing your path. The yellow cone is what it can see, and touching it counts too. Use `wait(seconds)` to let it walk past, then go.",
194
+ "starterCode": "step(500)\n",
195
+ "scene": {
196
+ "start": {
197
+ "x": 150,
198
+ "y": 250,
199
+ "angle": 0
200
+ },
201
+ "chips": [
202
+ {
203
+ "x": 650,
204
+ "y": 250
205
+ }
206
+ ],
207
+ "guards": [
208
+ {
209
+ "route": [
210
+ {
211
+ "x": 450,
212
+ "y": 60
213
+ },
214
+ {
215
+ "x": 450,
216
+ "y": 440
217
+ }
218
+ ],
219
+ "speed": 80
220
+ }
221
+ ]
222
+ }
223
+ },
224
+ {
225
+ "id": "server-room",
226
+ "title": "Server Room",
227
+ "instructions": "Three chips and one Sentry Bug. Follow the halls to the first two chips, stop one panel before the bug's path, and wait for your moment to cross. Then finish the job.",
228
+ "starterCode": "step(200)\nturn(-90)\n",
229
+ "scene": {
230
+ "start": {
231
+ "x": 150,
232
+ "y": 350,
233
+ "angle": 0
234
+ },
235
+ "chips": [
236
+ {
237
+ "x": 350,
238
+ "y": 350
239
+ },
240
+ {
241
+ "x": 350,
242
+ "y": 150
243
+ },
244
+ {
245
+ "x": 750,
246
+ "y": 350
247
+ }
248
+ ],
249
+ "obstacles": [
250
+ {
251
+ "x": 100,
252
+ "y": 100,
253
+ "w": 200,
254
+ "h": 200
255
+ },
256
+ {
257
+ "x": 400,
258
+ "y": 200,
259
+ "w": 200,
260
+ "h": 200
261
+ }
262
+ ],
263
+ "guards": [
264
+ {
265
+ "route": [
266
+ {
267
+ "x": 650,
268
+ "y": 440
269
+ },
270
+ {
271
+ "x": 650,
272
+ "y": 60
273
+ }
274
+ ],
275
+ "speed": 60
276
+ }
277
+ ]
278
+ }
279
+ },
280
+ {
281
+ "id": "square-dance",
282
+ "title": "Square Dance",
283
+ "instructions": "Four sides, all the same. Don't write it out four times. `for i in range(4):` repeats the lines indented under it. Add a `turn(90)` to the loop and set the distance.",
284
+ "starterCode": "for i in range(4):\n step(100)\n",
285
+ "scene": {
286
+ "start": {
287
+ "x": 300,
288
+ "y": 150,
289
+ "angle": 0
290
+ },
291
+ "chips": [
292
+ {
293
+ "x": 400,
294
+ "y": 150
295
+ },
296
+ {
297
+ "x": 500,
298
+ "y": 250
299
+ },
300
+ {
301
+ "x": 400,
302
+ "y": 350
303
+ },
304
+ {
305
+ "x": 300,
306
+ "y": 250
307
+ }
308
+ ],
309
+ "obstacles": [
310
+ {
311
+ "x": 350,
312
+ "y": 200,
313
+ "w": 100,
314
+ "h": 100
315
+ }
316
+ ]
317
+ }
318
+ },
319
+ {
320
+ "id": "boss-gatehouse",
321
+ "title": "Boss: Gatehouse",
322
+ "boss": true,
323
+ "instructions": "Boss fight. Grab the first chip, then go around the crate wall to the top lane. A Sentry Bug patrols the crossing, so hold your position with `wait` until it has turned around at the top and walked back past your lane. Cross behind it, then collect the last two chips.",
324
+ "starterCode": "step(150)\n",
325
+ "scene": {
326
+ "start": {
327
+ "x": 80,
328
+ "y": 250,
329
+ "angle": 0
330
+ },
331
+ "chips": [
332
+ {
333
+ "x": 230,
334
+ "y": 250
335
+ },
336
+ {
337
+ "x": 600,
338
+ "y": 100
339
+ },
340
+ {
341
+ "x": 600,
342
+ "y": 400
343
+ }
344
+ ],
345
+ "obstacles": [
346
+ {
347
+ "x": 290,
348
+ "y": 130,
349
+ "w": 40,
350
+ "h": 300
351
+ }
352
+ ],
353
+ "guards": [
354
+ {
355
+ "route": [
356
+ {
357
+ "x": 400,
358
+ "y": 440
359
+ },
360
+ {
361
+ "x": 400,
362
+ "y": 60
363
+ }
364
+ ],
365
+ "speed": 100
366
+ }
367
+ ]
368
+ }
369
+ },
370
+ {
371
+ "id": "staircase",
372
+ "title": "Staircase",
373
+ "instructions": "A loop can repeat several lines. Each stair is 100 steps along and 75 steps up. Write one whole stair inside the loop, ending with Grep Fox facing right again, then repeat it 5 times.",
374
+ "starterCode": "for i in range(5):\n step(100)\n turn(-90)\n",
375
+ "scene": {
376
+ "start": {
377
+ "x": 150,
378
+ "y": 450,
379
+ "angle": 0
380
+ },
381
+ "chips": [
382
+ {
383
+ "x": 650,
384
+ "y": 75
385
+ }
386
+ ],
387
+ "obstacles": [
388
+ {
389
+ "x": 0,
390
+ "y": 0,
391
+ "w": 230,
392
+ "h": 430
393
+ },
394
+ {
395
+ "x": 230,
396
+ "y": 0,
397
+ "w": 100,
398
+ "h": 355
399
+ },
400
+ {
401
+ "x": 330,
402
+ "y": 0,
403
+ "w": 100,
404
+ "h": 280
405
+ },
406
+ {
407
+ "x": 430,
408
+ "y": 0,
409
+ "w": 100,
410
+ "h": 205
411
+ },
412
+ {
413
+ "x": 530,
414
+ "y": 0,
415
+ "w": 100,
416
+ "h": 130
417
+ },
418
+ {
419
+ "x": 270,
420
+ "y": 400,
421
+ "w": 530,
422
+ "h": 100
423
+ },
424
+ {
425
+ "x": 370,
426
+ "y": 320,
427
+ "w": 430,
428
+ "h": 80
429
+ },
430
+ {
431
+ "x": 470,
432
+ "y": 245,
433
+ "w": 330,
434
+ "h": 75
435
+ },
436
+ {
437
+ "x": 570,
438
+ "y": 170,
439
+ "w": 230,
440
+ "h": 75
441
+ }
442
+ ]
443
+ }
444
+ },
445
+ {
446
+ "id": "long-stair",
447
+ "title": "Long Stair",
448
+ "instructions": "12 stairs, each 60 steps along and 30 steps up. That's far too much to type out, but your loop doesn't care. Change one number.",
449
+ "starterCode": "for i in range(2):\n step(60)\n turn(-90)\n step(30)\n turn(90)\n",
450
+ "scene": {
451
+ "start": {
452
+ "x": 40,
453
+ "y": 440,
454
+ "angle": 0
455
+ },
456
+ "chips": [
457
+ {
458
+ "x": 220,
459
+ "y": 350
460
+ },
461
+ {
462
+ "x": 400,
463
+ "y": 260
464
+ },
465
+ {
466
+ "x": 580,
467
+ "y": 170
468
+ },
469
+ {
470
+ "x": 760,
471
+ "y": 80
472
+ }
473
+ ]
474
+ }
475
+ },
476
+ {
477
+ "id": "zigzag",
478
+ "title": "Zigzag",
479
+ "instructions": "Up 300, right 75, down 300, right 75, and the whole pattern happens 4 times. Put all of one pattern inside the loop, including the turns.",
480
+ "starterCode": "for i in range(4):\n turn(-90)\n step(300)\n turn(90)\n step(75)\n",
481
+ "scene": {
482
+ "start": {
483
+ "x": 100,
484
+ "y": 400,
485
+ "angle": 0
486
+ },
487
+ "chips": [
488
+ {
489
+ "x": 700,
490
+ "y": 400
491
+ }
492
+ ],
493
+ "obstacles": [
494
+ {
495
+ "x": 120,
496
+ "y": 125,
497
+ "w": 35,
498
+ "h": 375
499
+ },
500
+ {
501
+ "x": 195,
502
+ "y": 0,
503
+ "w": 35,
504
+ "h": 375
505
+ },
506
+ {
507
+ "x": 270,
508
+ "y": 125,
509
+ "w": 35,
510
+ "h": 375
511
+ },
512
+ {
513
+ "x": 345,
514
+ "y": 0,
515
+ "w": 35,
516
+ "h": 375
517
+ },
518
+ {
519
+ "x": 420,
520
+ "y": 125,
521
+ "w": 35,
522
+ "h": 375
523
+ },
524
+ {
525
+ "x": 495,
526
+ "y": 0,
527
+ "w": 35,
528
+ "h": 375
529
+ },
530
+ {
531
+ "x": 570,
532
+ "y": 125,
533
+ "w": 35,
534
+ "h": 375
535
+ },
536
+ {
537
+ "x": 645,
538
+ "y": 0,
539
+ "w": 35,
540
+ "h": 375
541
+ }
542
+ ]
543
+ }
544
+ },
545
+ {
546
+ "id": "spiral-out",
547
+ "title": "Spiral Out",
548
+ "instructions": "Each side of this spiral is longer than the last. The loop variable `i` counts for you: `range(1, 3)` gives 1, then 2. Your code already walks `i * 60` steps, so make the range long enough for 5 sides.",
549
+ "starterCode": "for i in range(1, 3):\n step(i * 60)\n turn(90)\n",
550
+ "scene": {
551
+ "start": {
552
+ "x": 380,
553
+ "y": 240,
554
+ "angle": 0
555
+ },
556
+ "chips": [
557
+ {
558
+ "x": 440,
559
+ "y": 360
560
+ },
561
+ {
562
+ "x": 260,
563
+ "y": 360
564
+ },
565
+ {
566
+ "x": 260,
567
+ "y": 120
568
+ },
569
+ {
570
+ "x": 560,
571
+ "y": 120
572
+ }
573
+ ]
574
+ }
575
+ },
576
+ {
577
+ "id": "three-rooms",
578
+ "title": "Three Rooms",
579
+ "instructions": "Three rooms in a row. Walk around each room with 4 sides of 100 steps, then `step(200)` to reach the next one. That's a loop inside a loop, so watch your indents.",
580
+ "starterCode": "for side in range(4):\n step(100)\n turn(90)\n",
581
+ "scene": {
582
+ "start": {
583
+ "x": 150,
584
+ "y": 200,
585
+ "angle": 0
586
+ },
587
+ "chips": [
588
+ {
589
+ "x": 200,
590
+ "y": 300
591
+ },
592
+ {
593
+ "x": 150,
594
+ "y": 250
595
+ },
596
+ {
597
+ "x": 400,
598
+ "y": 300
599
+ },
600
+ {
601
+ "x": 350,
602
+ "y": 250
603
+ },
604
+ {
605
+ "x": 600,
606
+ "y": 300
607
+ },
608
+ {
609
+ "x": 550,
610
+ "y": 250
611
+ }
612
+ ],
613
+ "obstacles": [
614
+ {
615
+ "x": 175,
616
+ "y": 225,
617
+ "w": 50,
618
+ "h": 50
619
+ },
620
+ {
621
+ "x": 375,
622
+ "y": 225,
623
+ "w": 50,
624
+ "h": 50
625
+ },
626
+ {
627
+ "x": 575,
628
+ "y": 225,
629
+ "w": 50,
630
+ "h": 50
631
+ }
632
+ ]
633
+ }
634
+ },
635
+ {
636
+ "id": "bug-parade",
637
+ "title": "Bug Parade",
638
+ "instructions": "A parade of Sentry Bugs. You're safe when you stop halfway between two of them, so `step(200)` takes you from one safe spot to the next. Put a `wait` inside the loop and find the right number of seconds.",
639
+ "starterCode": "for i in range(3):\n step(200)\n",
640
+ "scene": {
641
+ "start": {
642
+ "x": 150,
643
+ "y": 250,
644
+ "angle": 0
645
+ },
646
+ "chips": [
647
+ {
648
+ "x": 750,
649
+ "y": 250
650
+ }
651
+ ],
652
+ "guards": [
653
+ {
654
+ "route": [
655
+ {
656
+ "x": 250,
657
+ "y": 60
658
+ },
659
+ {
660
+ "x": 250,
661
+ "y": 440
662
+ }
663
+ ],
664
+ "speed": 120
665
+ },
666
+ {
667
+ "route": [
668
+ {
669
+ "x": 450,
670
+ "y": 440
671
+ },
672
+ {
673
+ "x": 450,
674
+ "y": 60
675
+ }
676
+ ],
677
+ "speed": 120
678
+ },
679
+ {
680
+ "route": [
681
+ {
682
+ "x": 650,
683
+ "y": 60
684
+ },
685
+ {
686
+ "x": 650,
687
+ "y": 440
688
+ }
689
+ ],
690
+ "speed": 120
691
+ }
692
+ ]
693
+ }
694
+ },
695
+ {
696
+ "id": "fractal-garden",
697
+ "title": "Fractal Garden",
698
+ "instructions": "A growing spiral with a small room at each corner. Your code walks the spiral. At each corner, add a loop that walks a 50-step square, then turn. You'll need 4 corners in all.",
699
+ "starterCode": "for i in range(1, 3):\n step(i * 70)\n turn(90)\n",
700
+ "scene": {
701
+ "start": {
702
+ "x": 350,
703
+ "y": 230,
704
+ "angle": 0
705
+ },
706
+ "chips": [
707
+ {
708
+ "x": 470,
709
+ "y": 280
710
+ },
711
+ {
712
+ "x": 370,
713
+ "y": 420
714
+ },
715
+ {
716
+ "x": 160,
717
+ "y": 320
718
+ },
719
+ {
720
+ "x": 260,
721
+ "y": 40
722
+ }
723
+ ],
724
+ "obstacles": [
725
+ {
726
+ "x": 260,
727
+ "y": 130,
728
+ "w": 60,
729
+ "h": 180
730
+ }
731
+ ]
732
+ }
733
+ },
734
+ {
735
+ "id": "infiltration",
736
+ "title": "Infiltration",
737
+ "instructions": "Grep Fox, you're inside. Your target is one data chip. Each floor panel is 100 steps wide, and `step(100)` won't get you all the way. Adjust the number and press Run.",
738
+ "starterCode": "step(100)\n",
739
+ "scene": {
740
+ "start": {
741
+ "x": 100,
742
+ "y": 250,
743
+ "angle": 0
744
+ },
745
+ "chips": [
746
+ {
747
+ "x": 400,
748
+ "y": 250
749
+ }
750
+ ]
751
+ }
752
+ },
753
+ {
754
+ "id": "blind-corner",
755
+ "title": "Blind Corner",
756
+ "instructions": "Crates ahead, and you can't go through them. Go around. `turn(90)` turns right and `turn(-90)` turns left.",
757
+ "starterCode": "step(400)\n",
758
+ "scene": {
759
+ "start": {
760
+ "x": 100,
761
+ "y": 400,
762
+ "angle": 0
763
+ },
764
+ "chips": [
765
+ {
766
+ "x": 500,
767
+ "y": 150
768
+ }
769
+ ],
770
+ "obstacles": [
771
+ {
772
+ "x": 200,
773
+ "y": 150,
774
+ "w": 200,
775
+ "h": 180
776
+ }
777
+ ]
778
+ }
779
+ },
780
+ {
781
+ "id": "boss-growing-vaults",
782
+ "title": "Boss: Growing Vaults",
783
+ "boss": true,
784
+ "instructions": "Boss fight. Three vaults, each wider than the last: 100, 150, then 200 steps. Lasers fill the gaps between them, so stay on the floor line when you move on. Walk around each vault with `turn(-90)`, then `step(size + 50)` to reach the next one.",
785
+ "starterCode": "for i in range(1, 4):\n size = 50 + i * 50\n # walk the 4 sides of this vault\n # then step to the next vault\n",
786
+ "scene": {
787
+ "start": {
788
+ "x": 60,
789
+ "y": 400,
790
+ "angle": 0
791
+ },
792
+ "chips": [
793
+ {
794
+ "x": 160,
795
+ "y": 300
796
+ },
797
+ {
798
+ "x": 60,
799
+ "y": 300
800
+ },
801
+ {
802
+ "x": 360,
803
+ "y": 250
804
+ },
805
+ {
806
+ "x": 210,
807
+ "y": 250
808
+ },
809
+ {
810
+ "x": 610,
811
+ "y": 200
812
+ },
813
+ {
814
+ "x": 410,
815
+ "y": 200
816
+ }
817
+ ],
818
+ "obstacles": [
819
+ {
820
+ "x": 90,
821
+ "y": 330,
822
+ "w": 40,
823
+ "h": 40
824
+ },
825
+ {
826
+ "x": 240,
827
+ "y": 280,
828
+ "w": 90,
829
+ "h": 90
830
+ },
831
+ {
832
+ "x": 440,
833
+ "y": 230,
834
+ "w": 140,
835
+ "h": 140
836
+ }
837
+ ],
838
+ "hazards": [
839
+ {
840
+ "x": 182,
841
+ "y": 40,
842
+ "w": 6,
843
+ "h": 330
844
+ },
845
+ {
846
+ "x": 382,
847
+ "y": 40,
848
+ "w": 6,
849
+ "h": 330
850
+ }
851
+ ]
852
+ }
853
+ },
854
+ {
855
+ "id": "crate-alley",
856
+ "title": "Crate Alley",
857
+ "instructions": "Four chips in this alley. Collect them in order. You can give as many orders as you need, one on each line.",
858
+ "starterCode": "step(200)\nturn(-90)\n",
859
+ "scene": {
860
+ "start": {
861
+ "x": 100,
862
+ "y": 400,
863
+ "angle": 0
864
+ },
865
+ "chips": [
866
+ {
867
+ "x": 300,
868
+ "y": 400
869
+ },
870
+ {
871
+ "x": 300,
872
+ "y": 250
873
+ },
874
+ {
875
+ "x": 500,
876
+ "y": 250
877
+ },
878
+ {
879
+ "x": 500,
880
+ "y": 100
881
+ }
882
+ ],
883
+ "obstacles": [
884
+ {
885
+ "x": 100,
886
+ "y": 100,
887
+ "w": 150,
888
+ "h": 200
889
+ },
890
+ {
891
+ "x": 350,
892
+ "y": 300,
893
+ "w": 250,
894
+ "h": 150
895
+ }
896
+ ]
897
+ }
898
+ },
899
+ {
900
+ "id": "service-stairs",
901
+ "title": "Service Stairs",
902
+ "instructions": "These stairs repeat, so don't write every order. Put one stair inside a `for` loop: move 100 steps, turn left, move 75 steps, turn right.",
903
+ "starterCode": "for i in range(5):\n step(100)\n # add the rest of one stair here\n",
904
+ "scene": {
905
+ "start": {
906
+ "x": 100,
907
+ "y": 450,
908
+ "angle": 0
909
+ },
910
+ "chips": [
911
+ {
912
+ "x": 200,
913
+ "y": 375
914
+ },
915
+ {
916
+ "x": 300,
917
+ "y": 300
918
+ },
919
+ {
920
+ "x": 400,
921
+ "y": 225
922
+ },
923
+ {
924
+ "x": 500,
925
+ "y": 150
926
+ },
927
+ {
928
+ "x": 600,
929
+ "y": 75
930
+ }
931
+ ]
932
+ }
933
+ },
934
+ {
935
+ "id": "perimeter-sweep",
936
+ "title": "Perimeter Sweep",
937
+ "instructions": "Sweep the perimeter around the crate. Each side is the same, so one loop can handle the whole patrol.",
938
+ "starterCode": "for i in range(4):\n # walk one side, then turn the corner\n pass\n",
939
+ "scene": {
940
+ "start": {
941
+ "x": 200,
942
+ "y": 100,
943
+ "angle": 0
944
+ },
945
+ "chips": [
946
+ {
947
+ "x": 500,
948
+ "y": 100
949
+ },
950
+ {
951
+ "x": 500,
952
+ "y": 400
953
+ },
954
+ {
955
+ "x": 200,
956
+ "y": 400
957
+ }
958
+ ],
959
+ "obstacles": [
960
+ {
961
+ "x": 300,
962
+ "y": 180,
963
+ "w": 100,
964
+ "h": 140
965
+ }
966
+ ]
967
+ }
968
+ },
969
+ {
970
+ "id": "searchlight-yard",
971
+ "title": "Searchlight Yard",
972
+ "instructions": "Stay out of the searchlight. The chips form a hexagon around it: each side is 150 steps and each corner is a 60 degree turn.",
973
+ "starterCode": "for i in range(6):\n step(150)\n",
974
+ "scene": {
975
+ "start": {
976
+ "x": 325,
977
+ "y": 100,
978
+ "angle": 0
979
+ },
980
+ "chips": [
981
+ {
982
+ "x": 475,
983
+ "y": 100
984
+ },
985
+ {
986
+ "x": 550,
987
+ "y": 230
988
+ },
989
+ {
990
+ "x": 475,
991
+ "y": 360
992
+ },
993
+ {
994
+ "x": 325,
995
+ "y": 360
996
+ },
997
+ {
998
+ "x": 250,
999
+ "y": 230
1000
+ }
1001
+ ],
1002
+ "hazards": [
1003
+ {
1004
+ "x": 400,
1005
+ "y": 230,
1006
+ "r": 50
1007
+ }
1008
+ ]
1009
+ }
1010
+ },
1011
+ {
1012
+ "id": "target-list",
1013
+ "title": "Target List",
1014
+ "instructions": "Here's your target list. `chips` holds every chip in the room. `turn_to(c)` faces a chip and `distance_to(c)` tells you how far away it is, so you never need to measure.",
1015
+ "starterCode": "for c in chips:\n turn_to(c)\n # now walk to the chip\n",
1016
+ "scene": {
1017
+ "start": {
1018
+ "x": 100,
1019
+ "y": 100,
1020
+ "angle": 0
1021
+ },
1022
+ "chips": [
1023
+ {
1024
+ "x": 300,
1025
+ "y": 150
1026
+ },
1027
+ {
1028
+ "x": 500,
1029
+ "y": 100
1030
+ },
1031
+ {
1032
+ "x": 700,
1033
+ "y": 200
1034
+ },
1035
+ {
1036
+ "x": 500,
1037
+ "y": 350
1038
+ },
1039
+ {
1040
+ "x": 200,
1041
+ "y": 400
1042
+ }
1043
+ ]
1044
+ }
1045
+ },
1046
+ {
1047
+ "id": "standard-procedure",
1048
+ "title": "Standard Procedure",
1049
+ "instructions": "Time for a standard procedure. A function gives a name to orders you use often. Fill in `grab`, then choose your route carefully: `chips[0]` is across the searchlight, so start with the chip nearest you.",
1050
+ "starterCode": "def grab(chip):\n turn_to(chip)\n # walk to the chip\n\ngrab(chips[0])\n",
1051
+ "scene": {
1052
+ "start": {
1053
+ "x": 100,
1054
+ "y": 250,
1055
+ "angle": 0
1056
+ },
1057
+ "chips": [
1058
+ {
1059
+ "x": 700,
1060
+ "y": 250
1061
+ },
1062
+ {
1063
+ "x": 550,
1064
+ "y": 100
1065
+ },
1066
+ {
1067
+ "x": 250,
1068
+ "y": 100
1069
+ }
1070
+ ],
1071
+ "hazards": [
1072
+ {
1073
+ "x": 400,
1074
+ "y": 250,
1075
+ "r": 100
1076
+ }
1077
+ ]
1078
+ }
1079
+ },
1080
+ {
1081
+ "id": "recon-grid",
1082
+ "title": "Recon Grid",
1083
+ "instructions": "Functions can take inputs. Finish `square(size)`, sweep the small square, take 200 steps to reach the big one, then sweep that too.",
1084
+ "starterCode": "def square(size):\n for i in range(4):\n step(size)\n # turn the corner\n\nsquare(100)\n",
1085
+ "scene": {
1086
+ "start": {
1087
+ "x": 100,
1088
+ "y": 100,
1089
+ "angle": 0
1090
+ },
1091
+ "chips": [
1092
+ {
1093
+ "x": 200,
1094
+ "y": 100
1095
+ },
1096
+ {
1097
+ "x": 200,
1098
+ "y": 200
1099
+ },
1100
+ {
1101
+ "x": 100,
1102
+ "y": 200
1103
+ },
1104
+ {
1105
+ "x": 500,
1106
+ "y": 100
1107
+ },
1108
+ {
1109
+ "x": 500,
1110
+ "y": 300
1111
+ },
1112
+ {
1113
+ "x": 300,
1114
+ "y": 300
1115
+ }
1116
+ ],
1117
+ "obstacles": [
1118
+ {
1119
+ "x": 350,
1120
+ "y": 150,
1121
+ "w": 100,
1122
+ "h": 100
1123
+ }
1124
+ ]
1125
+ }
1126
+ },
1127
+ {
1128
+ "id": "cargo-bay",
1129
+ "title": "Cargo Bay",
1130
+ "instructions": "Crates block the way through the cargo bay. Put your detour in a function: turn left, walk 100, turn right, walk 200, turn right, walk 100, turn left. Then use a loop to repeat it. Keep clear of the laser.",
1131
+ "starterCode": "def around_crate():\n turn(-90)\n step(100)\n # finish the detour\n\nstep(100)\n",
1132
+ "scene": {
1133
+ "start": {
1134
+ "x": 50,
1135
+ "y": 300,
1136
+ "angle": 0
1137
+ },
1138
+ "chips": [
1139
+ {
1140
+ "x": 150,
1141
+ "y": 300
1142
+ },
1143
+ {
1144
+ "x": 350,
1145
+ "y": 300
1146
+ },
1147
+ {
1148
+ "x": 550,
1149
+ "y": 300
1150
+ },
1151
+ {
1152
+ "x": 750,
1153
+ "y": 300
1154
+ }
1155
+ ],
1156
+ "obstacles": [
1157
+ {
1158
+ "x": 200,
1159
+ "y": 250,
1160
+ "w": 100,
1161
+ "h": 100
1162
+ },
1163
+ {
1164
+ "x": 400,
1165
+ "y": 250,
1166
+ "w": 100,
1167
+ "h": 100
1168
+ },
1169
+ {
1170
+ "x": 600,
1171
+ "y": 250,
1172
+ "w": 100,
1173
+ "h": 100
1174
+ }
1175
+ ],
1176
+ "hazards": [
1177
+ {
1178
+ "x": 150,
1179
+ "y": 120,
1180
+ "w": 600,
1181
+ "h": 6
1182
+ }
1183
+ ]
1184
+ }
1185
+ },
1186
+ {
1187
+ "id": "decoy-vault",
1188
+ "title": "Decoy Vault",
1189
+ "instructions": "Intel confirms the red chips are decoys wired to the alarm. Every chip has a `trapped` value, so use `if not c.trapped:` to leave them alone.",
1190
+ "starterCode": "for c in chips:\n turn_to(c)\n step(distance_to(c))\n",
1191
+ "scene": {
1192
+ "start": {
1193
+ "x": 100,
1194
+ "y": 250,
1195
+ "angle": 0
1196
+ },
1197
+ "chips": [
1198
+ {
1199
+ "x": 250,
1200
+ "y": 100
1201
+ },
1202
+ {
1203
+ "x": 300,
1204
+ "y": 400,
1205
+ "trapped": true
1206
+ },
1207
+ {
1208
+ "x": 500,
1209
+ "y": 400
1210
+ },
1211
+ {
1212
+ "x": 450,
1213
+ "y": 150,
1214
+ "trapped": true
1215
+ },
1216
+ {
1217
+ "x": 700,
1218
+ "y": 150
1219
+ },
1220
+ {
1221
+ "x": 650,
1222
+ "y": 400,
1223
+ "trapped": true
1224
+ }
1225
+ ]
1226
+ }
1227
+ },
1228
+ {
1229
+ "id": "boss-double-cross",
1230
+ "title": "Boss: Double Cross",
1231
+ "boss": true,
1232
+ "instructions": "Boss fight. Write a `grab` function, loop over `chips` and skip the decoy. A Sentry Bug walks through the only gap between the lasers, so a short `wait` after each chip you grab will let it pass.",
1233
+ "starterCode": "def grab(chip):\n # face the chip and walk to it\n pass\n\nfor c in chips:\n # grab the chip unless it is trapped, then wait\n pass\n",
1234
+ "scene": {
1235
+ "start": {
1236
+ "x": 80,
1237
+ "y": 250,
1238
+ "angle": 0
1239
+ },
1240
+ "chips": [
1241
+ {
1242
+ "x": 250,
1243
+ "y": 120
1244
+ },
1245
+ {
1246
+ "x": 200,
1247
+ "y": 250,
1248
+ "trapped": true
1249
+ },
1250
+ {
1251
+ "x": 300,
1252
+ "y": 250
1253
+ },
1254
+ {
1255
+ "x": 600,
1256
+ "y": 250
1257
+ },
1258
+ {
1259
+ "x": 600,
1260
+ "y": 120
1261
+ }
1262
+ ],
1263
+ "hazards": [
1264
+ {
1265
+ "x": 130,
1266
+ "y": 120,
1267
+ "r": 40
1268
+ },
1269
+ {
1270
+ "x": 470,
1271
+ "y": 10,
1272
+ "w": 6,
1273
+ "h": 190
1274
+ },
1275
+ {
1276
+ "x": 470,
1277
+ "y": 300,
1278
+ "w": 6,
1279
+ "h": 190
1280
+ }
1281
+ ],
1282
+ "guards": [
1283
+ {
1284
+ "route": [
1285
+ {
1286
+ "x": 430,
1287
+ "y": 60
1288
+ },
1289
+ {
1290
+ "x": 430,
1291
+ "y": 440
1292
+ }
1293
+ ],
1294
+ "speed": 60
1295
+ }
1296
+ ]
1297
+ }
1298
+ },
1299
+ {
1300
+ "id": "extraction",
1301
+ "title": "Extraction",
1302
+ "instructions": "This is it. Use everything you've learned. Write a `grab` function, loop over `chips`, and skip the decoys. Watch out for the searchlight and the lasers, then get out.",
1303
+ "starterCode": "def grab(chip):\n # face the chip and walk to it\n pass\n\nfor c in chips:\n # grab the chip unless it is trapped\n pass\n",
1304
+ "scene": {
1305
+ "start": {
1306
+ "x": 100,
1307
+ "y": 250,
1308
+ "angle": 0
1309
+ },
1310
+ "chips": [
1311
+ {
1312
+ "x": 250,
1313
+ "y": 130
1314
+ },
1315
+ {
1316
+ "x": 250,
1317
+ "y": 370,
1318
+ "trapped": true
1319
+ },
1320
+ {
1321
+ "x": 450,
1322
+ "y": 130,
1323
+ "trapped": true
1324
+ },
1325
+ {
1326
+ "x": 450,
1327
+ "y": 370
1328
+ },
1329
+ {
1330
+ "x": 650,
1331
+ "y": 130
1332
+ },
1333
+ {
1334
+ "x": 650,
1335
+ "y": 370,
1336
+ "trapped": true
1337
+ }
1338
+ ],
1339
+ "hazards": [
1340
+ {
1341
+ "x": 350,
1342
+ "y": 100,
1343
+ "r": 40
1344
+ },
1345
+ {
1346
+ "x": 0,
1347
+ "y": 40,
1348
+ "w": 800,
1349
+ "h": 6
1350
+ },
1351
+ {
1352
+ "x": 0,
1353
+ "y": 460,
1354
+ "w": 800,
1355
+ "h": 6
1356
+ }
1357
+ ]
1358
+ }
1359
+ },
1360
+ {
1361
+ "id": "first-patrol",
1362
+ "title": "First Patrol",
1363
+ "instructions": "A Sentry Bug is on patrol. The yellow cone is what it can see, and touching it counts too. Use `wait(seconds)` to let it walk past, then move.",
1364
+ "starterCode": "step(600)\n",
1365
+ "scene": {
1366
+ "start": {
1367
+ "x": 100,
1368
+ "y": 250,
1369
+ "angle": 0
1370
+ },
1371
+ "chips": [
1372
+ {
1373
+ "x": 700,
1374
+ "y": 250
1375
+ }
1376
+ ],
1377
+ "guards": [
1378
+ {
1379
+ "route": [
1380
+ {
1381
+ "x": 400,
1382
+ "y": 70
1383
+ },
1384
+ {
1385
+ "x": 400,
1386
+ "y": 430
1387
+ }
1388
+ ],
1389
+ "speed": 80
1390
+ }
1391
+ ]
1392
+ }
1393
+ },
1394
+ {
1395
+ "id": "crate-cover",
1396
+ "title": "Crate Cover",
1397
+ "instructions": "There's no room to pass in this corridor, but crates block a Sentry Bug's view. Duck into the gap with `turn(-90)` and `step(150)`, then `wait` until it has gone by.",
1398
+ "starterCode": "step(340)\n",
1399
+ "scene": {
1400
+ "start": {
1401
+ "x": 60,
1402
+ "y": 250,
1403
+ "angle": 0
1404
+ },
1405
+ "chips": [
1406
+ {
1407
+ "x": 730,
1408
+ "y": 250
1409
+ }
1410
+ ],
1411
+ "obstacles": [
1412
+ {
1413
+ "x": 150,
1414
+ "y": 0,
1415
+ "w": 200,
1416
+ "h": 160
1417
+ },
1418
+ {
1419
+ "x": 450,
1420
+ "y": 0,
1421
+ "w": 250,
1422
+ "h": 160
1423
+ },
1424
+ {
1425
+ "x": 150,
1426
+ "y": 340,
1427
+ "w": 550,
1428
+ "h": 160
1429
+ }
1430
+ ],
1431
+ "guards": [
1432
+ {
1433
+ "route": [
1434
+ {
1435
+ "x": 770,
1436
+ "y": 250
1437
+ },
1438
+ {
1439
+ "x": 120,
1440
+ "y": 250
1441
+ }
1442
+ ],
1443
+ "speed": 80
1444
+ }
1445
+ ]
1446
+ }
1447
+ },
1448
+ {
1449
+ "id": "shift-change",
1450
+ "title": "Shift Change",
1451
+ "instructions": "Two Sentry Bugs, moving at different speeds. Your code can watch them: `guards[0].y` is how far down the first one is. Hold with a `while` loop until it has passed, then do the same for the second.",
1452
+ "starterCode": "while guards[0].y < 320:\n wait(0.1)\nstep(365)\n",
1453
+ "scene": {
1454
+ "start": {
1455
+ "x": 60,
1456
+ "y": 250,
1457
+ "angle": 0
1458
+ },
1459
+ "chips": [
1460
+ {
1461
+ "x": 740,
1462
+ "y": 250
1463
+ }
1464
+ ],
1465
+ "guards": [
1466
+ {
1467
+ "route": [
1468
+ {
1469
+ "x": 300,
1470
+ "y": 60
1471
+ },
1472
+ {
1473
+ "x": 300,
1474
+ "y": 440
1475
+ }
1476
+ ],
1477
+ "speed": 120
1478
+ },
1479
+ {
1480
+ "route": [
1481
+ {
1482
+ "x": 550,
1483
+ "y": 60
1484
+ },
1485
+ {
1486
+ "x": 550,
1487
+ "y": 440
1488
+ }
1489
+ ],
1490
+ "speed": 60
1491
+ }
1492
+ ]
1493
+ }
1494
+ },
1495
+ {
1496
+ "id": "night-watch",
1497
+ "title": "Night Watch",
1498
+ "instructions": "Final sweep. The red chip is a decoy, a laser blocks the low route to the last chip, and a Sentry Bug holds the high lane. Grab the first chip, drop down out of its sight, wait for it to pass, then slip over the laser.",
1499
+ "starterCode": "def go(target):\n turn_to(target)\n step(distance_to(target))\n\ngo(chips[0])\n",
1500
+ "scene": {
1501
+ "start": {
1502
+ "x": 80,
1503
+ "y": 420,
1504
+ "angle": -90
1505
+ },
1506
+ "chips": [
1507
+ {
1508
+ "x": 200,
1509
+ "y": 100
1510
+ },
1511
+ {
1512
+ "x": 450,
1513
+ "y": 260,
1514
+ "trapped": true
1515
+ },
1516
+ {
1517
+ "x": 700,
1518
+ "y": 420
1519
+ }
1520
+ ],
1521
+ "hazards": [
1522
+ {
1523
+ "x": 597,
1524
+ "y": 220,
1525
+ "w": 6,
1526
+ "h": 280
1527
+ }
1528
+ ],
1529
+ "guards": [
1530
+ {
1531
+ "route": [
1532
+ {
1533
+ "x": 760,
1534
+ "y": 120
1535
+ },
1536
+ {
1537
+ "x": 300,
1538
+ "y": 120
1539
+ }
1540
+ ],
1541
+ "speed": 100
1542
+ }
1543
+ ]
1544
+ }
1545
+ }
1546
+ ]
1547
+ }