-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathartemis.ts
1046 lines (952 loc) · 30.1 KB
/
artemis.ts
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
//enums
enum FourDirectionArrows {
//% blockIdentity="blocks.custom" enumval=986 block="Arrow Up Orange"
//% jres alias=ARROW_UP_ORANGE
ArrowUpOrange = 986,
//% blockIdentity="blocks.custom" enumval=985 block="Arrow Down Magenta"
//% jres alias=ARROW_DOWN_MAGENTA
ArrowDownMagenta = 985,
//% blockIdentity="blocks.custom" enumval=984 block="Arrow Right Yellow"
//% jres alias=ARROW_RIGHT_YELLOW
ArrowRightYellow = 984,
//% blockIdentity="blocks.custom" enumval=983 block="Arrow Left Blue"
//% jres alias=ARROW_LEFT_BLUE
ArrowLeftBlue = 983
}
enum IssHelpColors {
//% blockIdentity="blocks.custom" enumval=0 block="blue"
//% jres alias=BLUE_CARGO
BlueCargo = 0,
//% blockIdentity="blocks.custom" enumval=1 block="yellow"
//% jres alias=YELLOW_CARGO
YellowCargo = 1,
//% blockIdentity="blocks.custom" enumval=2 block="magenta"
//% jres alias=MAGENT_CARGO
MagentaCargo = 2
}
enum DockingRings {
//% blockIdentity="blocks.custom" enumval=17 block="Docking Ring Inner"
//% jres alias=DOCKING_RING_INNER
InnerRing = 17,
//% blockIdentity="blocks.custom" enumval=236 block="Docking Ring Middle"
//% jres alias=DOCKING_RING_MIDDLE
MiddleRing = 236,
//% blockIdentity="blocks.custom" enumval=159 block="Docking Ring Outer"
//% jres alias=DOCKING_RING_OUTER
OuterRing = 159
}
enum DockingObjective {
//% blockIdentity="blocks.custom" enumval=0 block="Set to Blue"
//% jres alias=SET_TO_BLUE
GotoBlue = 0,
//% blockIdentity="blocks.custom" enumval=1 block="Set to Green"
//% jres alias=SET_TO_GREEN
GotoGreen = 1,
//% blockIdentity="blocks.custom" enumval=2 block="Set to Red"
//% jres alias=SET_TO_RED
GotoRed = 2
}
enum CrewMealIngredients {
//% blockIdentity="blocks.custom" enumval=0 block="Place Peanuts"
//% jres alias=PLACE_PEANUTS
PlacePeanut = 0,
//% blockIdentity="blocks.custom" enumval=1 block="Place Green Peppers"
//% jres alias=PLACE_GREEN_PEPPERS
PlacePepper = 1,
//% blockIdentity="blocks.custom" enumval=2 block="Place Tomato Sauce"
//% jres alias=PLACE_TOMATO_SAUCE
PlaceSauce = 2
}
enum CrewMealAddIngredients {
//% blockIdentity="blocks.custom" enumval=0 block="Add Anchovies"
//% jres alias=ADD_ANCHOIVES
AddAnchovies = 0,
//% blockIdentity="blocks.custom" enumval=1 block="Add Cheese"
//% jres alias=ADD_CHEESE
AddCheese = 1,
//% blockIdentity="blocks.custom" enumval=2 block="Add Pepperoni"
//% jres alias=ADD_PEPPERONI
AddPepperoni = 2,
//% blockIdentity="blocks.custom" enumval=3 block="Add Tomato"
//% jres alias=ADD_TOMATO
AddTomato = 3
}
enum RehydrationOptions {
//% blockIdentity="blocks.custom" enumval=1 block="25 ml"
//% jres alias=25_ML
A25ML = 1,
//% blockIdentity="blocks.custom" enumval=1 block="50 ml"
//% jres alias=50_ML
A50ML = 1,
//% blockIdentity="blocks.custom" enumval=0 block="75 ml"
//% jres alias=75_ML
A75ML = 0,
//% blockIdentity="blocks.custom" enumval=1 block="100 ml"
//% jres alias=100_ML
A100ML = 1
}
enum ExerciseTimes {
//% block="70 min"
a,
//% block="90 min"
b,
//% block="110 min"
c,
//% block="130 min"
d,
//% block="150 min"
e
}
enum Clockwise {
//% block="clockwise"
Clockwise,
//% block="counterclockwise"
Counterclockwise
}
enum MoveDirection {
//% block="toward"
Toward,
//% block="away from"
Away
}
enum RotationAmount {
//% block="90°"
a = 0,
//% block="180°"
b = 1,
//% block="360°"
c = 2
}
enum RotationType {
//% block="pitch"
Pitch,
//% block="yaw"
Yaw,
//% block="roll"
Roll
}
enum onOffToggle {
//% block="on"
a,
//% block="off"
b
}
enum matrix_y_axis_full {
//% block="0"
a,
//% block="1"
b,
//% block="2"
c,
//% block="3"
d,
//% block="4"
e,
//% block="5"
f,
//% block="6"
g,
//% block="7"
h,
//% block="8"
i,
//% block="9"
j
}
enum matrix_x_axis_full {
//% block="A"
LogOak = 17, // LOG
//% block="B"
WhiteConcrete = 236, // CONCRETE
//% block="C"
WhiteTerracotta = 159, // TERRACOTTA
//% block="D"
WhiteStainedGlass = 241, // STAINED GLASS
//% block="E"
WhiteStainedGlassPane = 160, // STAINED GLASS PANE
//% block="F"
StoneSlab = 44, // STONE_SLAB
//% block="G"
RedSandstoneSlab = 182, //STONE_SLAB2
//% block="H"
WhiteShulkerBox = 218, // SHULKER_BOX
//% block="I"
DoubleStoneSlab = 43, // DOUBLE_STONE_SLAB
//% block="J"
DoubleRedSandstoneSlab = 181, // DOUBLE_STONE_SLAB2
//% block="K"
DoubleWoodenSlab = 157, // DOUBLE_WOODEN_SLAB
//% block="L"
OakWoodSlab = 158 // WOODEN_SLAB
}
// global variables
const communicationsTimeout = 100;
const start_game_position = world(0, 7, 0)
const default_signal_block = WHITE_CONCRETE
//% block="Artemis: Moon Journey" weight=200 color=#0B3D91 icon="\uf186"
namespace artemis {
/**
* Start Game Player 1
*/
//% block="`Generics.blastOff` go for launch"
export function startGameP1(): void {
signalBlock(0, 0, 1, default_signal_block)
}
/**
* Start Game Player 2
*/
//% block="`Generics.blastOff` go for launch"
export function startGameP2(): void {
signalBlock(0, 0, 2, default_signal_block)
}
/**
* Start Game Player 3
*/
//% block="`Generics.blastOff` go for launch"
export function startGameP3(): void {
signalBlock(0, 0, 3, default_signal_block)
}
/**
* Start Game Player 4
*/
//% block="`Generics.blastOff` go for launch"
export function startGameP4(): void {
signalBlock(0, 0, 4, default_signal_block)
}
/**
* Space Junk (Activity 16) Collect Debris
*/
//% block="`Generics.collectDebris` collect debris"
export function collectDebrisA16(): void {
signalBlock(0, 16, 1, default_signal_block)
}
/**
* Prox Ops (Activity 1)
* Player 2
*/
//% block="`Generics.orionMove` move %d booster"
export function orionMoveDirectionA1PX(d: MoveDirection): void {
switch (d) {
case MoveDirection.Toward:
signalBlock(0, 1, 1, ORANGE_CONCRETE)
break;
case MoveDirection.Away:
signalBlock(0, 1, 1, default_signal_block)
break;
}
}
/**
* Prox Ops (Activity 1)
* Player 2
*/
//% block="`Generics.orionMove` rotate %r by %o"
export function rotateOrionA2PX(r: Clockwise, o: RotationAmount): void {
let orion_rotate = 0
switch (r) {
case Clockwise.Clockwise:
orion_rotate = 17 // LOG
break;
case Clockwise.Counterclockwise:
orion_rotate = 236 // CONCRETE
break;
}
let rotation_amount = 0
switch (o) {
case RotationAmount.a:
rotation_amount = 0
break;
case RotationAmount.b:
rotation_amount = 1
break;
case RotationAmount.c:
rotation_amount = 4
break;
}
signalBlock(0, 1, 1, blocks.blockWithData(blocks.blockById(orion_rotate), rotation_amount))
}
/**
* Prox Ops (Activity 1)
* Player 2
*/
//% block="`Generics.orionMove` adjust %r by %o"
export function rollOrionA2PX(r: RotationType, o: RotationAmount): void {
let orion_rotate = 0
switch (r) {
case RotationType.Pitch:
orion_rotate = 17 // LOG
break;
case RotationType.Yaw:
orion_rotate = 1 // STONE
break;
case RotationType.Roll:
orion_rotate = 236 // CONCRETE
break;
}
let rotation_amount = 0
switch (o) {
case RotationAmount.a:
rotation_amount = 0
break;
case RotationAmount.b:
rotation_amount = 2
break;
case RotationAmount.c:
rotation_amount = 4
break;
}
signalBlock(0, 1, 1, blocks.blockWithData(blocks.blockById(orion_rotate), rotation_amount))
}
/**
* Docking Test (Activity 2) Player 2
*/
//% block="rotate %r to %o"
export function rotateRingA2P2(r: DockingRings, o: DockingObjective): void {
let docking_ring = 0
switch (r) {
case DockingRings.InnerRing:
docking_ring = 17 // LOG
break;
case DockingRings.MiddleRing:
docking_ring = 236 // CONCRETE
break;
case DockingRings.OuterRing:
docking_ring = 159 // TERRACOTTA
break;
}
let docking_color = 0
switch (o) {
case DockingObjective.GotoBlue:
docking_color = 0
break;
case DockingObjective.GotoGreen:
docking_color = 1
break;
case DockingObjective.GotoRed:
docking_color = 2
break;
}
signalBlock(0, 2, 1, blocks.blockWithData(blocks.blockById(docking_ring), docking_color))
}
/**
* Docking Test (Activity 2) Player 3
*/
//% block="rotate %r to %o"
export function rotateRingA2P3(r: DockingRings, o: DockingObjective): void {
let docking_ring = 0
switch (r) {
case DockingRings.InnerRing:
docking_ring = 17 // LOG
break;
case DockingRings.MiddleRing:
docking_ring = 236 // CONCRETE
break;
case DockingRings.OuterRing:
docking_ring = 159 // TERRACOTTA
break;
}
let docking_color = 0
switch (o) {
case DockingObjective.GotoBlue:
docking_color = 0
break;
case DockingObjective.GotoGreen:
docking_color = 1
break;
case DockingObjective.GotoRed:
docking_color = 2
break;
}
signalBlock(0, 2, 1, blocks.blockWithData(blocks.blockById(docking_ring), docking_color))
}
/**
* Docking Test (Activity 2) Player 4
*/
//% block="rotate %r to %o"
export function rotateRingA2P4(r: DockingRings, o: DockingObjective): void {
let docking_ring = 0
switch (r) {
case DockingRings.InnerRing:
docking_ring = 17 // LOG
break;
case DockingRings.MiddleRing:
docking_ring = 236 // CONCRETE
break;
case DockingRings.OuterRing:
docking_ring = 159 // TERRACOTTA
break;
}
let docking_color = 0
switch (o) {
case DockingObjective.GotoBlue:
docking_color = 0
break;
case DockingObjective.GotoGreen:
docking_color = 1
break;
case DockingObjective.GotoRed:
docking_color = 2
break;
}
signalBlock(0, 2, 1, blocks.blockWithData(blocks.blockById(docking_ring), docking_color))
}
/**
* Radiation Drill (Activity 3)
* Player 4
*/
//% block="`Generics.clearCargo` clear cargo"
export function clearShelterA3P2(): void {
signalBlock(0, 3, 2, default_signal_block)
}
/**
* Radiation Drill (Activity 3)
* Player 3
*/
//% block="`Generics.surroundShelter` surround shelter"
export function surroundShelterA3P3(): void {
signalBlock(0, 3, 3, default_signal_block)
}
/**
* Radiation Drill (Activity 3)
* Player 2
*/
//% block="`Generics.coverShelter` cover shelter"
export function coverShelterA3P4(): void {
signalBlock(0, 3, 4, default_signal_block)
}
/**
* Human Physiology (Activity 4) Player 2
*/
//% block="`Generics.exercise` exercise for %t"
export function exerciseTimeA4P2(t: ExerciseTimes): void {
switch (t) {
case ExerciseTimes.a:
signalBlock(0, 4, 2, default_signal_block)
break;
case ExerciseTimes.b:
signalBlock(0, 4, 2, ORANGE_CONCRETE)
break;
case ExerciseTimes.c:
signalBlock(0, 4, 2, ORANGE_CONCRETE)
break;
case ExerciseTimes.d:
signalBlock(0, 4, 2, ORANGE_CONCRETE)
break;
case ExerciseTimes.e:
signalBlock(0, 4, 2, ORANGE_CONCRETE)
break;
}
}
/**
* Human Physiology (Activity 4) Player 3
*/
//% block="`Generics.exercise` exercise for %t"
export function exerciseTimeA4P3(t: ExerciseTimes): void {
switch (t) {
case ExerciseTimes.a:
signalBlock(0, 4, 3, ORANGE_CONCRETE)
break;
case ExerciseTimes.b:
signalBlock(0, 4, 3, ORANGE_CONCRETE)
break;
case ExerciseTimes.c:
signalBlock(0, 4, 3, default_signal_block)
break;
case ExerciseTimes.d:
signalBlock(0, 4, 3, ORANGE_CONCRETE)
break;
case ExerciseTimes.e:
signalBlock(0, 4, 3, ORANGE_CONCRETE)
break;
}
}
/**
* Human Physiology (Activity 4) Player 4
*/
//% block="`Generics.exercise` exercise for %t"
export function exerciseTimeA4P4(t: ExerciseTimes): void {
switch (t) {
case ExerciseTimes.a:
signalBlock(0, 4, 4, ORANGE_CONCRETE)
break;
case ExerciseTimes.b:
signalBlock(0, 4, 4, ORANGE_CONCRETE)
break;
case ExerciseTimes.c:
signalBlock(0, 4, 4, ORANGE_CONCRETE)
break;
case ExerciseTimes.d:
signalBlock(0, 4, 4, ORANGE_CONCRETE)
break;
case ExerciseTimes.e:
signalBlock(0, 4, 4, default_signal_block)
break;
}
}
/**
* Mars Recon (Activity 11)
*/
//% block="`Generics.takePicture` take picture"
export function takePictureA11(): void {
signalBlock(0, 11, 1, default_signal_block)
}
/**
* Building Blocks (Activity 5)
* Player 1
*/
//% block="`Generics.roverMove` rover move %d by %n"
export function roverMoveA5(d: FourDirectionArrows, n: number): void {
switch (d) {
case FourDirectionArrows.ArrowUpOrange:
agent.move(SixDirection.Up, n * 3)
break;
case FourDirectionArrows.ArrowDownMagenta:
agent.move(SixDirection.Down, n * 3)
break;
case FourDirectionArrows.ArrowRightYellow:
agent.move(SixDirection.Right, n * 3)
break;
case FourDirectionArrows.ArrowLeftBlue:
agent.move(SixDirection.Left, n * 3)
break;
}
}
/**
* Building Blocks (Activity 5)
* Player 1
*/
//% block="`Generics.collectRegolith` collect regolith"
export function collectBlockA5(): void {
signalBlock(0, 5, 1, default_signal_block)
}
/**
* Building Blocks (Activity 5)
* Player 2
*/
//% block="`Generics.meltRegolith` process regolith"
export function meltRegolithA5(): void {
signalBlock(0, 5, 2, default_signal_block)
}
/**
* Building Blocks (Activity 5)
* Player 2
*/
//% block="`Generics.castRegolith` cast block"
export function castBlocksA5(): void {
signalBlock(1, 5, 2, default_signal_block)
}
/**
* Building Blocks (Activity 5)
* Player 2
*/
//% block="`Generics.testBlockStrength` test block-strength"
export function testBlockStrengthA5(): void {
signalBlock(2, 5, 2, default_signal_block)
}
/**
* Ice Drilling (Activity 6)
* Player 1
*/
//% block="`Generics.roverMove` rover move %d by %n"
export function roverMoveA6(d: FourDirectionArrows, n: number): void {
switch (d) {
case FourDirectionArrows.ArrowUpOrange:
agent.move(SixDirection.Up, n * 3)
break;
case FourDirectionArrows.ArrowDownMagenta:
agent.move(SixDirection.Down, n * 3)
break;
case FourDirectionArrows.ArrowRightYellow:
agent.move(SixDirection.Right, n * 3)
break;
case FourDirectionArrows.ArrowLeftBlue:
agent.move(SixDirection.Left, n * 3)
break;
}
}
/**
* Ice Drilling (Activity 6)
* Player 2
*/
//% block="`Generics.drillDown` drill down"
export function drillDownA6(): void {
signalBlock(0, 6, 2, default_signal_block)
}
/**
* Ice Drilling (Activity 6)
* Player 2
*/
//% block="`Generics.collectSample` collect sample"
export function collectSampleA6(): void {
signalBlock(1, 6, 2, default_signal_block)
}
/**
* Moon Mapping (Activity 8) Player 1
*/
//% block="`Generics.markLocation` mark location $x_axis $y_axis"
export function setLocationA8P1(x_axis: matrix_x_axis_full, y_axis: matrix_y_axis_full): void {
signalBlock(0, 8, 1, blocks.blockWithData(blocks.blockById(x_axis), y_axis))
}
/**
* Moon Mapping (Activity 8) Player 2
*/
//% block="`Generics.takePicture` take picture"
export function takePictureA8P2(): void {
signalBlock(0, 8, 2, default_signal_block)
}
/**
* Moon Mapping (Activity 8) Player 2
* Player 1
*/
//% block="`Generics.viperMove` VIPER move %d by %n"
export function viperMoveA8P2(d: FourDirectionArrows, n: number): void {
switch (d) {
case FourDirectionArrows.ArrowUpOrange:
agent.move(SixDirection.Up, n * 3)
break;
case FourDirectionArrows.ArrowDownMagenta:
agent.move(SixDirection.Down, n * 3)
break;
case FourDirectionArrows.ArrowRightYellow:
agent.move(SixDirection.Right, n * 3)
break;
case FourDirectionArrows.ArrowLeftBlue:
agent.move(SixDirection.Left, n * 3)
break;
}
}
/**
* Crew Meals (Activity 9)
* Player 1
*/
//% block="`Generics.PowerSwitch` toggle power %i"
export function togglePowerA9P1(i: onOffToggle): void {
switch (i) {
case onOffToggle.a:
signalBlock(0, 9, 1, default_signal_block)
break;
case onOffToggle.b:
signalBlock(0, 9, 1, ORANGE_CONCRETE)
break;
}
}
/**
* Crew Meals (Activity 9)
* Player 1
*/
//% block="`Generics.place` place freeze-dried %i"
export function placeIngredientA9P1(i: CrewMealIngredients): void {
switch (i) {
case CrewMealIngredients.PlacePeanut:
signalBlock(1, 9, 1, ORANGE_CONCRETE)
break;
case CrewMealIngredients.PlacePepper:
signalBlock(1, 9, 1, ORANGE_CONCRETE)
break;
case CrewMealIngredients.PlaceSauce:
signalBlock(1, 9, 1, default_signal_block)
break;
}
}
/**
* Crew Meals (Activity 9)
* Player 1
*/
//% block="`Generics.Rehydrate` rehydrate with %i water"
export function rehydrateA9P1(i: RehydrationOptions): void {
switch (i) {
case RehydrationOptions.A25ML:
signalBlock(2, 9, 1, YELLOW_CONCRETE)
break;
case RehydrationOptions.A50ML:
signalBlock(2, 9, 1, ORANGE_CONCRETE)
break;
case RehydrationOptions.A75ML:
signalBlock(2, 9, 1, WHITE_CONCRETE)
break;
case RehydrationOptions.A100ML:
signalBlock(2, 9, 1, GREEN_CONCRETE)
break;
}
}
/**
* Crew Meals (Activity 9)
* Player 2
*/
//% block="`Generics.plus` add %i"
export function addIngredientsA9P2(i: CrewMealAddIngredients): void {
switch (i) {
case CrewMealAddIngredients.AddAnchovies:
signalBlock(0, 9, 2, default_signal_block)
break;
case CrewMealAddIngredients.AddCheese:
signalBlock(0, 9, 2, ORANGE_CONCRETE)
break;
case CrewMealAddIngredients.AddPepperoni:
signalBlock(0, 9, 2, YELLOW_CONCRETE)
break;
case CrewMealAddIngredients.AddTomato:
signalBlock(0, 9, 2, GREEN_CONCRETE)
break;
}
}
/**
* Crew Meals (Activity 9)
* Player 2
*/
//% block="`Generics.pizzaServe` serve pizza"
export function servePizzaA9P2(): void {
signalBlock(1, 9, 2, default_signal_block)
}
/**
* Asteroid Mining (Activity 12)
*/
//% block="`Generics.mineBlock` mine asteroid"
export function mineAsteroidA12(): void {
signalBlock(0, 12, 1, default_signal_block)
}
/**
* Lunar Garden (Activity 13)
* Player 1
*/
//% block="`Generics.agentMove` agent move %d by %n"
export function agentMoveA13(d: FourDirectionArrows, n: number): void {
switch (d) {
case FourDirectionArrows.ArrowUpOrange:
agent.move(SixDirection.Up, n)
break;
case FourDirectionArrows.ArrowDownMagenta:
agent.move(SixDirection.Down, n)
break;
case FourDirectionArrows.ArrowRightYellow:
agent.move(SixDirection.Forward, n)
break;
case FourDirectionArrows.ArrowLeftBlue:
agent.move(SixDirection.Back, n)
break;
}
}
/**
* Water Recycling (Activity 20)
*/
//% block="`Generics.agentMove` agent move %d by %n"
export function agentMoveA20(d: FourDirectionArrows, n: number): void {
switch (d) {
case FourDirectionArrows.ArrowUpOrange:
agent.move(SixDirection.Up, n)
break;
case FourDirectionArrows.ArrowDownMagenta:
agent.move(SixDirection.Down, n)
break;
case FourDirectionArrows.ArrowRightYellow:
agent.move(SixDirection.Forward, n)
break;
case FourDirectionArrows.ArrowLeftBlue:
agent.move(SixDirection.Back, n)
break;
}
}
/**
* Water Recycling (Activity 20)
*/
//% block="`Generics.removeDebris` remove debris"
export function removeDebrisA20(): void {
signalBlock(0, 20, 1, default_signal_block)
}
/**
* Lunar Garden 1 (Activity 13)
*/
//% block="`Generics.plantSeed` plant seed"
export function lunarGarden1A13(): void {
signalBlock(0, 13, 1, default_signal_block)
}
/**
* ISS Help (Activity 21)
* GOAL Blue
*/
//% block="`Generics.retrieveCargo` retrieve cargo %c"
export function retrieveBlueGoalA21(c: IssHelpColors): void {
let docking_ring = RED_CONCRETE
switch (c) {
case IssHelpColors.BlueCargo:
docking_ring = default_signal_block
break;
}
signalBlock(0, 21, 1, docking_ring)
}
/**
* ISS Help (Activity 21)
* GOAL Yellow
*/
//% block="`Generics.retrieveCargo` retrieve cargo %i"
export function retrieveYellowGoalA21(c: IssHelpColors): void {
let docking_ring = RED_CONCRETE
switch (c) {
case IssHelpColors.YellowCargo:
docking_ring = default_signal_block
break;
}
signalBlock(0, 21, 1, docking_ring)
}
/**
* ISS Help (Activity 21)
* GOAL Magenta
*/
//% block="`Generics.retrieveCargo` retrieve cargo %i"
export function retrieveMagentaGoalA21(c: IssHelpColors): void {
let docking_ring = RED_CONCRETE
switch (c) {
case IssHelpColors.MagentaCargo:
docking_ring = default_signal_block
break;
}
signalBlock(0, 21, 1, docking_ring)
}
/**
* ISS Help (Activity 21)
* load cargo
*/
//% block="`Generics.loadCargo` load cargo"
export function loadCargoA21(): void {
signalBlock(0, 21, 1, ORANGE_CONCRETE)
}
/**
* Agent Move Footsize 1
*/
//% block="`Generics.agentMove` agent move %d by %n"
export function agentMoveFoot1(d: FourDirectionArrows, n: number): void {
switch (d) {
case FourDirectionArrows.ArrowUpOrange:
agent.move(SixDirection.Up, n)
break;
case FourDirectionArrows.ArrowDownMagenta:
agent.move(SixDirection.Down, n)
break;
case FourDirectionArrows.ArrowRightYellow:
agent.move(SixDirection.Right, n)
break;
case FourDirectionArrows.ArrowLeftBlue:
agent.move(SixDirection.Left, n)
break;
}
}
/**
* Agent Move Footsize 3
*/
//% block="`Generics.agentMove` agent move %d by %n"
export function agentMoveFoot3(d: FourDirectionArrows, n: number): void {
switch (d) {
case FourDirectionArrows.ArrowUpOrange:
agent.move(SixDirection.Up, n * 3)
break;
case FourDirectionArrows.ArrowDownMagenta:
agent.move(SixDirection.Down, n * 3)
break;
case FourDirectionArrows.ArrowRightYellow:
agent.move(SixDirection.Right, n * 3)
break;
case FourDirectionArrows.ArrowLeftBlue:
agent.move(SixDirection.Left, n * 3)
break;
}
}
/**
* Space Junk (Activity 16) ADRV Move
*/
//% block="`Generics.agentMove` agent move %d by %n"
export function adrvMoveA16(d: FourDirectionArrows, n: number): void {
switch (d) {
case FourDirectionArrows.ArrowUpOrange:
agent.move(SixDirection.Up, n)
break;
case FourDirectionArrows.ArrowDownMagenta:
agent.move(SixDirection.Down, n)
break;
case FourDirectionArrows.ArrowRightYellow:
agent.move(SixDirection.Forward, n)
break;
case FourDirectionArrows.ArrowLeftBlue:
agent.move(SixDirection.Back, n)
break;
}
}
/**
* Asteroid Mining (Activity 12) Rover Move
*/
//% block="`Generics.roverMove` rover move %d by %n"
export function roverMoveA12(d: FourDirectionArrows, n: number): void {
switch (d) {
case FourDirectionArrows.ArrowUpOrange:
agent.move(SixDirection.Up, n)
break;
case FourDirectionArrows.ArrowDownMagenta:
agent.move(SixDirection.Down, n)
break;
case FourDirectionArrows.ArrowRightYellow:
agent.move(SixDirection.Right, n)
break;
case FourDirectionArrows.ArrowLeftBlue:
agent.move(SixDirection.Left, n)
break;
}
}
/**
* Mars Recon (Activity 11) Rover Move
*/
//% block="`Generics.ingenuityMove` Ingenuity move %d by %n"
export function roverMoveA11(d: FourDirectionArrows, n: number): void {
switch (d) {
case FourDirectionArrows.ArrowUpOrange:
agent.move(SixDirection.Up, n * 3)
break;
case FourDirectionArrows.ArrowDownMagenta:
agent.move(SixDirection.Down, n * 3)
break;
case FourDirectionArrows.ArrowRightYellow:
agent.move(SixDirection.Right, n * 3)
break;
case FourDirectionArrows.ArrowLeftBlue:
agent.move(SixDirection.Left, n * 3)
break;
}
}
/**