pxt-microbit 7.0.13 → 7.0.15

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.
Files changed (54) hide show
  1. package/built/block-tests.js +1 -1
  2. package/built/common-sim.js +5 -5
  3. package/built/hexcache/{cb1b89b5febf846e20413f33f34b0649f662c6c856cdfc30b0bc766a37cf0dfa.hex → 0732e6383c21bfe20c40a8e9fe3784db8f5d85289bc7496a4366a5dce01f197c.hex} +6750 -6750
  4. package/built/hexcache/{d9847d963d09454741232337ee6d32ba4a4de678d0995b2829ed46157276a5b2.hex → 2f49babe14d51d847bde5c10754a0acb03db2bb140b9e84b3be886621d6ecc29.hex} +7213 -7213
  5. package/built/hexcache/68c1d66616cdc9b29dab3af0dee93deac852344f969783fe2f39c9758791337a.hex +19720 -0
  6. package/built/hexcache/d7311504e3fadadd391f7e3b175d0bf532c9352419f404676608d2417c615cbc.hex +20321 -0
  7. package/built/sim.d.ts +7 -2
  8. package/built/sim.js +102 -40
  9. package/built/target-strings.json +1 -1
  10. package/built/target.js +1 -1
  11. package/built/target.json +1 -1
  12. package/built/targetlight.json +1 -1
  13. package/built/web/blockly.css +1 -1
  14. package/built/web/rtlblockly.css +1 -1
  15. package/built/web/rtlsemantic.css +3 -3
  16. package/built/web/semantic.css +3 -3
  17. package/docs/courses.md +1 -1
  18. package/docs/extensions/extension-gallery.md +17 -13
  19. package/docs/projects/SUMMARY.md +1 -1
  20. package/docs/projects/hot-potato.md +1 -1
  21. package/docs/projects/level.md +7 -7
  22. package/docs/projects/plot-acceleration.md +1 -1
  23. package/docs/projects/python/smiley-buttons.md +6 -10
  24. package/docs/projects/spy/7-seconds.md +9 -9
  25. package/docs/projects/spy/coin-flipper.md +8 -8
  26. package/docs/projects/spy/compass.md +9 -9
  27. package/docs/projects/spy/heads-guess.md +10 -10
  28. package/docs/projects/spy/hot-potato.md +8 -8
  29. package/docs/projects/spy/level.md +7 -7
  30. package/docs/projects/spy/stopwatch.md +7 -7
  31. package/docs/projects/spy/tug-of-led.md +8 -8
  32. package/docs/projects/stopwatch.md +8 -8
  33. package/docs/projects/tug-of-led.md +8 -8
  34. package/docs/projects/v2-play-sound.md +8 -8
  35. package/docs/reference/basic/show-arrow.md +2 -2
  36. package/docs/reference/basic/show-leds.md +1 -2
  37. package/docs/reference/basic/show-number.md +2 -3
  38. package/docs/reference/basic/show-string.md +2 -4
  39. package/docs/reference/game/clear.md +1 -1
  40. package/docs/reference/images/create-big-image.md +1 -1
  41. package/docs/reference/images/create-image.md +4 -5
  42. package/docs/reference/images/plot-frame.md +1 -1
  43. package/docs/reference/images/plot-image.md +1 -1
  44. package/docs/reference/images/scroll-image.md +1 -2
  45. package/docs/reference/images/show-frame.md +1 -1
  46. package/docs/reference/images/show-image.md +1 -1
  47. package/docs/reference/images/width.md +1 -2
  48. package/docs/reference/pins/set-audio-pin-enabled.md +38 -0
  49. package/docs/reference/pins/set-audio-pin.md +2 -1
  50. package/package.json +3 -3
  51. package/pxtarget.json +2 -1
  52. package/targetconfig.json +3 -37
  53. package/built/hexcache/0b0ef5aa10458cd792db8bb60d6016582a48904c3caf6491fee8c4fed1dcebe1.hex +0 -20347
  54. package/built/hexcache/2e8285fb3e0552598a6cfc14b7f1458b7a93baad71011f78c6f93598c5381e38.hex +0 -19748
package/docs/courses.md CHANGED
@@ -102,7 +102,7 @@ Tutorials, lessons, and mini-courses about programming and computing.
102
102
  }, {
103
103
  "name": "Networking with the micro:bit",
104
104
  "description": "A series of activities to teach the basics of computer networks.",
105
- "url": "https://microbit.nominetresearch.uk/",
105
+ "url": "https://www.digitaltechnologieshub.edu.au/search/networking-with-the-micro-bit/",
106
106
  "imageUrl": "/static/courses/networking-book.png"
107
107
  }, {
108
108
  "name": "SparkFun Videos",
@@ -13,55 +13,55 @@ Many extensions are available to work with interface kits, add-on hardware, or o
13
13
  ```codecard
14
14
  [{
15
15
  "name": "Display",
16
- "url": "/extensions#display",
16
+ "url": "/extensions/extension-gallery#display",
17
17
  "cardType": "link"
18
18
  }, {
19
19
  "name": "Electronics",
20
- "url": "/extensions#electronics",
20
+ "url": "/extensions/extension-gallery#electronics",
21
21
  "cardType": "link"
22
22
  }, {
23
23
  "name": "Gaming",
24
- "url": "/extensions#gaming",
24
+ "url": "/extensions/extension-gallery#gaming",
25
25
  "cardType": "link"
26
26
  }, {
27
27
  "name": "Individual sensors",
28
- "url": "/extensions#individual-sensors",
28
+ "url": "/extensions/extension-gallery#individual-sensors",
29
29
  "cardType": "link"
30
30
  }, {
31
31
  "name": "IoT",
32
- "url": "/extensions#iot",
32
+ "url": "/extensions/extension-gallery#iot",
33
33
  "cardType": "link"
34
34
  }, {
35
35
  "name": "Kits",
36
- "url": "/extensions#kits",
36
+ "url": "/extensions/extension-gallery#kits",
37
37
  "cardType": "link"
38
38
  }, {
39
39
  "name": "LEDs and lights",
40
- "url": "/extensions#leds-and-lights",
40
+ "url": "/extensions/extension-gallery#leds-and-lights",
41
41
  "cardType": "link"
42
42
  }, {
43
43
  "name": "Machine learning",
44
- "url": "/extensions#machine-learning",
44
+ "url": "/extensions/extension-gallery#machine-learning",
45
45
  "cardType": "link"
46
46
  }, {
47
47
  "name": "Robotics",
48
- "url": "/extensions#robotics",
48
+ "url": "/extensions/extension-gallery#robotics",
49
49
  "cardType": "link"
50
50
  }, {
51
51
  "name": "Sensor boards",
52
- "url": "/extensions#sensor-boards",
52
+ "url": "/extensions/extension-gallery#sensor-boards",
53
53
  "cardType": "link"
54
54
  }, {
55
55
  "name": "Sound",
56
- "url": "/extensions#sound",
56
+ "url": "/extensions/extension-gallery#sound",
57
57
  "cardType": "link"
58
58
  }, {
59
59
  "name": "Wearables",
60
- "url": "/extensions#wearables",
60
+ "url": "/extensions/extension-gallery#wearables",
61
61
  "cardType": "link"
62
62
  }, {
63
63
  "name": "Utilities",
64
- "url": "/extensions#utilities",
64
+ "url": "/extensions/extension-gallery#utilities",
65
65
  "cardType": "link"
66
66
  }]
67
67
  ```
@@ -521,6 +521,10 @@ Many extensions are available to work with interface kits, add-on hardware, or o
521
521
 
522
522
  ```codecard
523
523
  [{
524
+ "name": "Lectrify Brick:Bit",
525
+ "url":"/pkg/softsmyth/lectrify-b4k",
526
+ "cardType": "package"
527
+ }, {
524
528
  "name": "KittenBot TabbyBot",
525
529
  "url":"/pkg/KittenBot/pxt-tabbyrobot",
526
530
  "cardType": "package"
@@ -137,7 +137,7 @@
137
137
  * [micro:bit Data and Sustainability](https://mrmorrison.co.uk/microbit/datasustainability/)
138
138
  * [First Steps](https://microbit.org/get-started/first-steps/introduction/)
139
139
  * [Make it: code it](https://microbit.org/projects/make-it-code-it/)
140
- * [Networking with the micro:bit](https://microbit.nominetresearch.uk/)
140
+ * [Networking with the micro:bit](https://www.digitaltechnologieshub.edu.au/search/networking-with-the-micro-bit/)
141
141
  * [SparkFun Videos](https://youtu.be/kaNtg1HGXbY?list=PLBcrWxTa5CS0mWJrytvii8aG5KUqMXvSk)
142
142
  * [Logic Lab](/courses/logic-lab)
143
143
  * [CodeJoy Remote Robotics](https://www.codejoyeducation.com)
@@ -60,7 +60,7 @@ input.onButtonPressed(Button.A, function () {
60
60
 
61
61
  ## {Step 5}
62
62
 
63
- Inside the ``||loops:while||`` loop, add code to ``||variables:decrease||`` the timer ``||loops:every second||``.
63
+ Inside the ``||loops:while||`` loop, add code to ``||variables:decrease||`` the timer for every ``||basic:pause||`` of one second.
64
64
 
65
65
  ```blocks
66
66
  let timer = 0
@@ -1,13 +1,13 @@
1
1
  # Level
2
2
 
3
- ## Introduction @unplugged
3
+ ## Is it level? @unplugged
4
4
 
5
5
  Is your table flat? Use the @boardname@ as a level!
6
6
 
7
7
  ![A level drawing](/static/mb/projects/level.png)
8
8
 
9
9
 
10
- ## Step 1
10
+ ## {Step 1}
11
11
 
12
12
  Make a variable ``||variables:x||`` and store the ``||input:acceleration x||`` value
13
13
  in the ``||basic:forever||`` loop.
@@ -19,7 +19,7 @@ basic.forever(function() {
19
19
  })
20
20
  ```
21
21
 
22
- ## Step 2
22
+ ## {Step 2}
23
23
 
24
24
  Make another variable ``||variables:y||`` and store the ``||input:acceleration y||`` value.
25
25
 
@@ -31,7 +31,7 @@ basic.forever(function() {
31
31
  })
32
32
  ```
33
33
 
34
- ## Step 3
34
+ ## {Step 3}
35
35
 
36
36
  Add a code to test ``||logic:if||`` the ``||Math:absolute value||`` of ``||variables:x||`` is ``||logic:greater than||`` ``32``.
37
37
  If it is true, ``||basic:show an icon||`` to tell you that the @boardname@ is not flat, ``||logic:else||`` show nothing, for now.
@@ -49,7 +49,7 @@ basic.forever(function() {
49
49
  })
50
50
  ```
51
51
 
52
- ## Step 4
52
+ ## {Step 4}
53
53
 
54
54
  Add an ``||logic:else if||`` to check that the ``||Math:absolute value||`` of ``||variables:y||`` is ``||logic:greater than||`` ``32``.
55
55
  If it is true, ``||basic:show an icon||`` that tells you the @boardname@ is not flat.
@@ -69,7 +69,7 @@ basic.forever(function() {
69
69
  })
70
70
  ```
71
71
 
72
- ## Step 5
72
+ ## {Step 5}
73
73
 
74
74
  The code under the ``||logic:else||`` will run if both acceleration ``x`` and ``y`` are small, which happens when the @boardname@ is laying flat. Add code to ``||basic:show a happy image||``.
75
75
 
@@ -88,7 +88,7 @@ basic.forever(function() {
88
88
  })
89
89
  ```
90
90
 
91
- ## Step 6
91
+ ## {Step 6}
92
92
 
93
93
  If you have a @boardname@ connected, click ``|Download|`` to transfer your code!
94
94
  Try it out on a table, counter, or window sill in your house!
@@ -37,7 +37,7 @@ basic.forever(function() {
37
37
 
38
38
  ## Other sensors
39
39
 
40
- You can use this block for pretty much any kind of data. Try it out! Plot the ``||input:light level||`` inside the ``||loops:forever||`` instead. Play with the light sensor in the simulator.
40
+ You can use this block for pretty much any kind of data. Try it out! Plot the ``||input:light level||`` inside the ``||basic:forever||`` instead. Play with the light sensor in the simulator.
41
41
 
42
42
  ```blocks
43
43
  basic.forever(function() {
@@ -2,14 +2,14 @@
2
2
 
3
3
  ### @explicitHints true
4
4
 
5
- ## Introduction @unplugged
5
+ ## Code a micro:bit emoji! @unplugged
6
6
 
7
7
  Code the buttons on the @boardname@ to show that it's happy or sad.
8
8
  (Want to learn how the buttons works? [Watch this video](https://youtu.be/t_Qujjd_38o)).
9
9
 
10
10
  ![Pressing the A and B buttons](/static/mb/projects/smiley-buttons/sim.gif)
11
11
 
12
- ## Step 1
12
+ ## {Step 1}
13
13
 
14
14
  Put in an ``||input:on button pressed||`` event to run code when button **A** is pressed.
15
15
 
@@ -19,7 +19,7 @@ def on_button_pressed_a():
19
19
  input.on_button_pressed(Button.A, on_button_pressed_a)
20
20
  ```
21
21
 
22
- ## Step 2
22
+ ## {Step 2}
23
23
 
24
24
  Use ``||basic:show icon||`` to display a **Happy** face on the screen.
25
25
 
@@ -31,7 +31,7 @@ def on_button_pressed_a():
31
31
  input.on_button_pressed(Button.A, on_button_pressed_a)
32
32
  ```
33
33
 
34
- ## Step 3
34
+ ## {Step 3}
35
35
 
36
36
  Use another ``||input:on button pressed||`` with a ``||basic:show icon||`` inside to display a **Sad** face when button **B** is pressed.
37
37
 
@@ -41,7 +41,7 @@ def on_button_pressed_a2():
41
41
  input.on_button_pressed(Button.B, on_button_pressed_a2)
42
42
  ```
43
43
 
44
- ## Step 4
44
+ ## {Step 4}
45
45
 
46
46
  Add a secret mode that happens when **A** and **B** are pressed together. For this case, use ``||basic:show icon||`` multiple times to create an animation.
47
47
 
@@ -52,10 +52,6 @@ def on_button_pressed_a3():
52
52
  input.on_button_pressed(Button.AB, on_button_pressed_a3)
53
53
  ```
54
54
 
55
- ## Step 5
55
+ ## {Step 5}
56
56
 
57
57
  Click ``|Download|`` to transfer your code to your @boardname@ (if you have one). Try buttons **A**, **B** and then **A** and **B** together.
58
-
59
- ## Step 6
60
-
61
- If you have a @boardname@ connected, click ``|Download|`` and transfer your code to the @boardname@!
@@ -2,15 +2,15 @@
2
2
 
3
3
  ### @explicitHints true
4
4
 
5
- ## Introduction @unplugged
5
+ ## Can you react at the right time? @unplugged
6
6
 
7
7
  The goal of this game is press a button after **exactly** 7 seconds!
8
8
 
9
9
  ![A micro:bit looking at a 7 second stopwatch](/static/mb/projects/7-seconds.png)
10
10
 
11
- This game is inspired from the [flipping panckakes game](https://www.elecfreaks.com/blog/post/flipping-pancakes-microbit-game.html).
11
+ This game is inspired from the [flipping pancakes game](https://www.elecfreaks.com/blog/post/flipping-pancakes-microbit-game.html).
12
12
 
13
- ## Step 1
13
+ ## {Step 1}
14
14
 
15
15
  The player starts the timer by pressing button **A**. Add the code to run code when
16
16
  ``||input:button A is pressed||``.
@@ -21,7 +21,7 @@ input.onButtonPressed(Button.A, function () {
21
21
  })
22
22
  ```
23
23
 
24
- ## Step 2
24
+ ## {Step 2}
25
25
 
26
26
  We need to remember the time when the button was pressed so that we can compute the elapsed
27
27
  time later on. Add code to store the ``||input:running time||`` in a ``||variables:start||``
@@ -35,7 +35,7 @@ input.onButtonPressed(Button.A, function () {
35
35
  })
36
36
  ```
37
37
 
38
- ## Step 3
38
+ ## {Step 3}
39
39
 
40
40
  Show something on the screen so that the user knows that the timer has started...
41
41
 
@@ -48,7 +48,7 @@ input.onButtonPressed(Button.A, function () {
48
48
  })
49
49
  ```
50
50
 
51
- ## Step 4
51
+ ## {Step 4}
52
52
 
53
53
  The player stops the timer by pressing button **B**. Add another event to run code when
54
54
  ``||input:button B is pressed||``.
@@ -59,7 +59,7 @@ input.onButtonPressed(Button.B, function () {
59
59
  })
60
60
  ```
61
61
 
62
- ## Step 5
62
+ ## {Step 5}
63
63
 
64
64
  Compute the elapsed time as ``||input:running time||`` ``||math:minus||`` ``||variables:start||`` and
65
65
  store it in a new local variable (a variable only inside the event) called ``||variables:elapsed||``.
@@ -72,7 +72,7 @@ input.onButtonPressed(Button.B, function () {
72
72
  })
73
73
  ```
74
74
 
75
- ## Step 6
75
+ ## {Step 6}
76
76
 
77
77
  Compute the ``||variables:score||`` of the game as the ``||math:absolute value||`` of the
78
78
  ``||math:difference||`` of ``||variables:elapsed||`` time from 7 seconds, which is `7000`
@@ -87,7 +87,7 @@ input.onButtonPressed(Button.B, function () {
87
87
  })
88
88
  ```
89
89
 
90
- ## Step 7
90
+ ## {Step 7}
91
91
 
92
92
  Display the score on the screen and your game is ready!
93
93
 
@@ -2,13 +2,13 @@
2
2
 
3
3
  ### @explicitHints true
4
4
 
5
- ## Introduction @unplugged
5
+ ## Heads or Tails? @unplugged
6
6
 
7
7
  Let's create a coin flipping program to simulate a real coin toss. We'll use icon images to represent a ``heads`` or ``tails`` result.
8
8
 
9
9
  ![Simulating coin toss](/static/mb/projects/coin-flipper/coin-flipper.gif)
10
10
 
11
- ## Step 1
11
+ ## {Step 1}
12
12
 
13
13
  Add an event to run code when ``||input:button A pressed||``. We'll put our coin flipping
14
14
  code in here.
@@ -18,7 +18,7 @@ input.onButtonPressed(Button.A, () => {
18
18
  })
19
19
  ```
20
20
 
21
- ## Step 2
21
+ ## {Step 2}
22
22
 
23
23
  Inside the event for ``||input:button A pressed||``, put in code to check ``||logic:if||`` a ``||math:random boolean||`` value is `true` or `false`.
24
24
 
@@ -33,7 +33,7 @@ input.onButtonPressed(Button.A, () => {
33
33
  })
34
34
  ```
35
35
 
36
- ## Step 3
36
+ ## {Step 3}
37
37
 
38
38
  Now, ``||basic:show icon||`` for a `skull` ``||logic:if||`` the ``||math:random boolean||`` value is ``true``. This means ``heads``. ``||basic:show icon||`` of a ``square`` when ``false`` to mean
39
39
  ``tails``.
@@ -48,11 +48,11 @@ input.onButtonPressed(Button.A, () => {
48
48
  })
49
49
  ```
50
50
 
51
- ## Step 4
51
+ ## {Step 4}
52
52
 
53
53
  Press button **A** in the simulator to try the coin toss code.
54
54
 
55
- ## Step 5
55
+ ## {Step 5}
56
56
 
57
57
  You can animate the coin toss to add the feeling of suspense. ``||basic:show||`` different
58
58
  icons before the check of the ``||math:random boolean||`` value to show that the
@@ -72,10 +72,10 @@ input.onButtonPressed(Button.A, () => {
72
72
  })
73
73
  ```
74
74
 
75
- ## Step 6
75
+ ## {Step 6}
76
76
 
77
77
  If you have a @boardname@, connect it to USB and click ``|Download|`` to transfer your code.
78
78
 
79
- ## Step 7
79
+ ## {Step 7}
80
80
 
81
81
  Press button **A** for a flip. Test your luck and guess ``heads`` or ``tails`` before the toss is over!
@@ -1,12 +1,12 @@
1
1
  # Compass
2
2
 
3
- ## Introduction @unplugged
3
+ ## Find your direction! @unplugged
4
4
 
5
5
  This tutorial will show you how to program a script that displays which direction the @boardname@ is pointing. Let's get started!
6
6
 
7
7
  ![A cartoon of a compass](/static/mb/projects/a5-compass.png)
8
8
 
9
- ## Step 1
9
+ ## {Step 1}
10
10
 
11
11
  Store the ``||input:compass heading||`` of the @boardname@ in a variable called ``||variables:degrees||`` in the ``||basic:forever||`` loop.
12
12
 
@@ -16,7 +16,7 @@ basic.forever(function() {
16
16
  })
17
17
  ```
18
18
 
19
- ## Step 2
19
+ ## {Step 2}
20
20
 
21
21
  ``||logic:If||`` ``||variables:degrees||`` is ``||logic:less than||`` `45`,
22
22
  then the compass heading is mostly pointing toward **North**. ``||basic:Show||`` `N` on the @boardname@.
@@ -30,7 +30,7 @@ basic.forever(function() {
30
30
  })
31
31
  ```
32
32
 
33
- ## Step 3
33
+ ## {Step 3}
34
34
 
35
35
  ``||logic:If||`` ``||variables:degrees||`` is less than `135`, the @boardname@ is mostly pointing **East**. ``||basic:Show||`` `E` on the @boardname@.
36
36
 
@@ -46,11 +46,11 @@ basic.forever(function() {
46
46
  })
47
47
  ```
48
48
 
49
- ## Step 4
49
+ ## {Step 4}
50
50
 
51
51
  Go to the simulator and rotate the @boardname@ logo to simulate changes in the compass heading.
52
52
 
53
- ## Step 5
53
+ ## {Step 5}
54
54
 
55
55
  ``||logic:If||`` ``||variables:degrees||`` is less than `225`, the @boardname@ is mostly pointing **South**. ``||basic:Show||`` `S` on the @boardname@.
56
56
 
@@ -69,7 +69,7 @@ basic.forever(function() {
69
69
  })
70
70
  ```
71
71
 
72
- ## Step 6
72
+ ## {Step 6}
73
73
 
74
74
  ``||logic:If||`` ``||variables:degrees||`` is less than `315`, the @boardname@ is mostly pointing **West**. ``||basic:Show||`` `W` on the @boardname@.
75
75
 
@@ -89,7 +89,7 @@ basic.forever(function() {
89
89
  })
90
90
  ```
91
91
 
92
- ## Step 7
92
+ ## {Step 7}
93
93
 
94
94
  ``||logic:If||`` none of these conditions returned true, then the @boardname@ must be pointing **North** again. Display `N` on the @boardname@.
95
95
 
@@ -114,7 +114,7 @@ basic.forever(function() {
114
114
  })
115
115
  ```
116
116
 
117
- ## Step 8 @unplugged
117
+ ## Download @unplugged
118
118
 
119
119
  If you have a @boardname@, click `|Download|` and follow the screen instructions.
120
120
  You will have to follow the screen instructions to calibrate your compass.
@@ -2,12 +2,12 @@
2
2
 
3
3
  ### @explicitHints true
4
4
 
5
- ## Introduction @unplugged
5
+ ## Make a Heads Up guessing game! @unplugged
6
6
 
7
7
  This is a simple remake of the famous **Heads Up!** game. The player holds the @boardname@ on the forehead and has 30 seconds to guess words displayed on the screen.
8
8
  If the guess is correct, the player tilts the @boardname@ forward; to pass, the player tilts it backwards.
9
9
 
10
- ## Step 1
10
+ ## {Step 1}
11
11
 
12
12
  Put in code to ``||game:start a countdown||`` of 30 seconds.
13
13
 
@@ -15,7 +15,7 @@ Put in code to ``||game:start a countdown||`` of 30 seconds.
15
15
  game.startCountdown(30000)
16
16
  ```
17
17
 
18
- ## Step 2
18
+ ## {Step 2}
19
19
 
20
20
  Create an ``||arrays:array||`` called `text_list` of words to guess. Arrays are also called lists.
21
21
 
@@ -25,7 +25,7 @@ text_list = ["PUPPY", "CLOCK", "NIGHT"]
25
25
  game.startCountdown(30000)
26
26
  ```
27
27
 
28
- ## Step 3
28
+ ## {Step 3}
29
29
 
30
30
  Add an event to run code when a ``||input:gesture||`` points the @boardname@ ``||input:logo up||``.
31
31
  This is the gesture to get a new word.
@@ -36,7 +36,7 @@ input.onGesture(Gesture.LogoUp, function () {
36
36
  })
37
37
  ```
38
38
 
39
- ## Step 4
39
+ ## {Step 4}
40
40
 
41
41
  The items in the ``||arrays:text list||`` are numbered ``0`` to ``length - 1``.
42
42
  Add code to pick a ``||math:random||`` ``||variables:index||``.
@@ -50,7 +50,7 @@ input.onGesture(Gesture.LogoUp, function () {
50
50
  })
51
51
  ```
52
52
 
53
- ## Step 5
53
+ ## {Step 5}
54
54
 
55
55
  Add code to ``||basic:show||`` the value of the item stored at ``||variables:index||`` in
56
56
  ``||arrays:text list||``.
@@ -65,7 +65,7 @@ input.onGesture(Gesture.LogoUp, function () {
65
65
  })
66
66
  ```
67
67
 
68
- ## Step 6
68
+ ## {Step 6}
69
69
 
70
70
  Use an event to run code when a gesture has the @boardname@ ``||input:screen||`` is
71
71
  pointing ``||input:down||``. This is the gesture for a correct guess.
@@ -76,7 +76,7 @@ input.onGesture(Gesture.ScreenDown, function () {
76
76
  })
77
77
  ```
78
78
 
79
- ## Step 7
79
+ ## {Step 7}
80
80
 
81
81
  Put in code to add points to the ``||game:score||``.
82
82
 
@@ -87,7 +87,7 @@ input.onGesture(Gesture.ScreenDown, function () {
87
87
  })
88
88
  ```
89
89
 
90
- ## Step 8
90
+ ## {Step 8}
91
91
 
92
92
  Add anonther event to run code when a gesture has the @boardname@ ``||input:screen||`` is
93
93
  pointing ``||input:up||``. This is the gesture for a pass.
@@ -98,7 +98,7 @@ input.onGesture(Gesture.ScreenUp, function () {
98
98
  })
99
99
  ```
100
100
 
101
- ## Step 9
101
+ ## {Step 9}
102
102
 
103
103
  For the pass gesture, add code to remove a ``||game:life||`` from the player.
104
104
 
@@ -3,12 +3,12 @@
3
3
  ### @explicitHints true
4
4
  ### @diffs true
5
5
 
6
- ## Introduction @unplugged
6
+ ## Pass off that potato! @unplugged
7
7
 
8
8
  In this game, you will start a timer with a random countdown of a number of seconds. When the timer is off, the game is over and whoever is holding the potato has lost!
9
9
  Watch the tutorial on the [MakeCode YouTube channel](https://youtu.be/xLEy1B_gWKY).
10
10
 
11
- ## Step 1
11
+ ## {Step 1}
12
12
 
13
13
  Add an event to run code when ``||input:button A is pressed||``.
14
14
 
@@ -18,7 +18,7 @@ input.onButtonPressed(Button.A, function () {
18
18
  })
19
19
  ```
20
20
 
21
- ## Step 2
21
+ ## {Step 2}
22
22
 
23
23
  Make a variable named ``||variables:timer||`` and set it to a ``||math:random value||``
24
24
  between ``5`` and ``15``.
@@ -33,7 +33,7 @@ input.onButtonPressed(Button.A, function () {
33
33
  })
34
34
  ```
35
35
 
36
- ## Step 3
36
+ ## {Step 3}
37
37
 
38
38
  Add code to ``||basic:show an icon||`` to indicate that the game has started.
39
39
 
@@ -45,7 +45,7 @@ input.onButtonPressed(Button.A, function () {
45
45
  })
46
46
  ```
47
47
 
48
- ## Step 4
48
+ ## {Step 4}
49
49
 
50
50
  Put in a ``||basic:pause||`` to wait the number of seconds set in the variable ``||variables:timer||``. When the ``||basic:pause||`` completes, the game is over.
51
51
 
@@ -58,7 +58,7 @@ input.onButtonPressed(Button.A, function () {
58
58
  })
59
59
  ```
60
60
 
61
- ## Step 5
61
+ ## {Step 5}
62
62
 
63
63
  **After** the ``||basic:pause||``, add code to ``||basic:show||`` that the game is over.
64
64
 
@@ -72,7 +72,7 @@ input.onButtonPressed(Button.A, function () {
72
72
  })
73
73
  ```
74
74
 
75
- ## Step 6
75
+ ## {Step 6}
76
76
 
77
77
  You can simplify your code by replacing ``||variables:timer||`` in the ``||basic:pause||`` with a ``||math:random value||`` between ``5`` and ``15``. Now, delete the other lines using the ``||variables:timer||`` variable.
78
78
 
@@ -84,6 +84,6 @@ input.onButtonPressed(Button.A, function () {
84
84
  })
85
85
  ```
86
86
 
87
- ## Step 7
87
+ ## {Step 7}
88
88
 
89
89
  `|Download|` your code to your @boardname@, tape it to a potato and play the game with your friends!
@@ -2,14 +2,14 @@
2
2
 
3
3
  ### @explicitHints true
4
4
 
5
- ## Introduction @unplugged
5
+ ## Is it level? @unplugged
6
6
 
7
7
  Is your table flat? Use the @boardname@ as a level!
8
8
 
9
9
  ![A level drawing](/static/mb/projects/level.png)
10
10
 
11
11
 
12
- ## Step 1
12
+ ## {Step 1}
13
13
 
14
14
  Make a variable ``||variables:x||`` and store the ``||input:acceleration x||`` value
15
15
  in the ``||basic:forever||`` loop.
@@ -21,7 +21,7 @@ basic.forever(function() {
21
21
  })
22
22
  ```
23
23
 
24
- ## Step 2
24
+ ## {Step 2}
25
25
 
26
26
  Make another variable ``||variables:y||`` and store the ``||input:acceleration y||`` value.
27
27
 
@@ -33,7 +33,7 @@ basic.forever(function() {
33
33
  })
34
34
  ```
35
35
 
36
- ## Step 3
36
+ ## {Step 3}
37
37
 
38
38
  Add a code to test ``||logic:if||`` the ``||Math:absolute value||`` of ``||variables:x||`` is ``||logic:greater than||`` ``32``.
39
39
  If it is true, ``||basic:show an icon||`` to tell you that the @boardname@ is not flat, ``||logic:else||`` show nothing, for now.
@@ -51,7 +51,7 @@ basic.forever(function() {
51
51
  })
52
52
  ```
53
53
 
54
- ## Step 4
54
+ ## {Step 4}
55
55
 
56
56
  Add an ``||logic:else if||`` to check that the ``||Math:absolute value||`` of ``||variables:y||`` is ``||logic:greater than||`` ``32``.
57
57
  If it is true, ``||basic:show an icon||`` that tells you the @boardname@ is not flat.
@@ -71,7 +71,7 @@ basic.forever(function() {
71
71
  })
72
72
  ```
73
73
 
74
- ## Step 5
74
+ ## {Step 5}
75
75
 
76
76
  The code under the ``||logic:else||`` will run if both acceleration ``x`` and ``y`` are small, which happens when the @boardname@ is laying flat. Add code to ``||basic:show a happy image||``.
77
77
 
@@ -90,7 +90,7 @@ basic.forever(function() {
90
90
  })
91
91
  ```
92
92
 
93
- ## Step 6
93
+ ## {Step 6}
94
94
 
95
95
  If you have a @boardname@ connected, click ``|Download|`` to transfer your code!
96
96
  Try it out on a table, counter, or window sill in your house!