pxt-microbit 7.1.13 → 7.1.14
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.
- package/README.md +1 -2
- package/built/block-tests.js +1 -1
- package/built/common-sim.d.ts +1 -0
- package/built/common-sim.js +7 -0
- package/built/hexcache/{62d118def080a75f4b90d209ebe58cd840107cd7ac1117a03048f9f3a9ba459b.hex → 55639532a88cab7365a995dd19138a4085b2435262f5783f2cc2204a1e210a6c.hex} +10896 -10895
- package/built/hexcache/{fdf1ab3d8ac409b08a7bad3101a8cf88efd749b98912bfca0a660343ba9ffbb2.hex → c5a9e0a8ad381a258b95357cf7aa140734c79ef987eb172003e8571d37bb6fbf.hex} +2885 -2883
- package/built/hexcache/{f87dd6f924d49825ab4194658e7dd59cbdcf515452bdad421a017a6c6d4d5653.hex → f254b35661aec9c97b86444b02fe17ed0fa65ad03b8ab65dd2ef6c66e74259fe.hex} +2492 -2492
- package/built/hexcache/{953452662f79855758a87af818a099e09ef3e0dbdf688053dca6821efeafd26b.hex → f9d55de9d2511f3a9625351415d9c95513d63a475e4a4c9f23db905d22e80af0.hex} +9783 -9783
- package/built/sim.d.ts +1 -0
- package/built/sim.js +7 -0
- package/built/target.js +1 -1
- package/built/target.json +1 -1
- package/built/targetlight.json +1 -1
- package/built/web/react-common-authcode.css +1 -1
- package/built/web/react-common-multiplayer.css +1 -1
- package/built/web/react-common-skillmap.css +1 -1
- package/built/web/rtlreact-common-authcode.css +1 -1
- package/built/web/rtlreact-common-multiplayer.css +1 -1
- package/built/web/rtlreact-common-skillmap.css +1 -1
- package/built/web/rtlsemantic.css +1 -1
- package/built/web/semantic.css +1 -1
- package/docs/projects/reaction-time/code.md +88 -0
- package/docs/test/courses/csintro.md +6 -5
- package/package.json +4 -4
- package/targetconfig.json +1 -1
|
@@ -306,3 +306,91 @@ input.onPinPressed(TouchPin.P2, function () {
|
|
|
306
306
|
}
|
|
307
307
|
})
|
|
308
308
|
```
|
|
309
|
+
|
|
310
|
+
## Extending the Extension
|
|
311
|
+
|
|
312
|
+
One effect of the extension is the **X** for a false start shows for the person loosing the game. We can extend the code some more to avoid the **X** showing up on the person loosing the game. The following example uses a new variable to flag the winner and avoid the **X** after a winner is crowned.
|
|
313
|
+
|
|
314
|
+
```blocks
|
|
315
|
+
input.onPinPressed(TouchPin.P0, function () {
|
|
316
|
+
running = false
|
|
317
|
+
false_start = false
|
|
318
|
+
Winner = 0
|
|
319
|
+
basic.showNumber(3)
|
|
320
|
+
basic.showNumber(2)
|
|
321
|
+
basic.showNumber(1)
|
|
322
|
+
basic.clearScreen()
|
|
323
|
+
basic.pause(1000 + randint(0, 2000))
|
|
324
|
+
if (!(false_start)) {
|
|
325
|
+
start = input.runningTime()
|
|
326
|
+
running = true
|
|
327
|
+
led.stopAnimation()
|
|
328
|
+
basic.clearScreen()
|
|
329
|
+
led.plotBrightness(randint(0, 4), randint(0, 4), 255)
|
|
330
|
+
}
|
|
331
|
+
})
|
|
332
|
+
input.onPinPressed(TouchPin.P2, function () {
|
|
333
|
+
if (running) {
|
|
334
|
+
running = false
|
|
335
|
+
end = input.runningTime()
|
|
336
|
+
Winner = 2
|
|
337
|
+
basic.showLeds(`
|
|
338
|
+
. . . # #
|
|
339
|
+
. . . # #
|
|
340
|
+
. . . # #
|
|
341
|
+
. . . # #
|
|
342
|
+
. . . # #
|
|
343
|
+
`)
|
|
344
|
+
basic.pause(1000)
|
|
345
|
+
basic.showNumber(end - start)
|
|
346
|
+
} else if (Winner == 1) {
|
|
347
|
+
|
|
348
|
+
} else {
|
|
349
|
+
false_start = true
|
|
350
|
+
basic.showLeds(`
|
|
351
|
+
. . . . .
|
|
352
|
+
. . # . #
|
|
353
|
+
. . . # .
|
|
354
|
+
. . # . #
|
|
355
|
+
. . . . .
|
|
356
|
+
`)
|
|
357
|
+
}
|
|
358
|
+
})
|
|
359
|
+
input.onPinPressed(TouchPin.P1, function () {
|
|
360
|
+
if (running) {
|
|
361
|
+
running = false
|
|
362
|
+
end = input.runningTime()
|
|
363
|
+
Winner = 1
|
|
364
|
+
basic.showLeds(`
|
|
365
|
+
# # . . .
|
|
366
|
+
# # . . .
|
|
367
|
+
# # . . .
|
|
368
|
+
# # . . .
|
|
369
|
+
# # . . .
|
|
370
|
+
`)
|
|
371
|
+
basic.pause(1000)
|
|
372
|
+
basic.showNumber(end - start)
|
|
373
|
+
} else if (Winner == 2) {
|
|
374
|
+
|
|
375
|
+
} else {
|
|
376
|
+
false_start = true
|
|
377
|
+
basic.showLeds(`
|
|
378
|
+
. . . . .
|
|
379
|
+
# . # . .
|
|
380
|
+
. # . . .
|
|
381
|
+
# . # . .
|
|
382
|
+
. . . . .
|
|
383
|
+
`)
|
|
384
|
+
}
|
|
385
|
+
})
|
|
386
|
+
let Winner = 0
|
|
387
|
+
let start = 0
|
|
388
|
+
let end = 0
|
|
389
|
+
let false_start = false
|
|
390
|
+
let running = false
|
|
391
|
+
running = false
|
|
392
|
+
false_start = false
|
|
393
|
+
end = 0
|
|
394
|
+
start = 0
|
|
395
|
+
Winner = 0
|
|
396
|
+
```
|
|
@@ -52,14 +52,15 @@ Flipcode for the **Intro to CS** course grid: **[csintromicrobit](https://flipgr
|
|
|
52
52
|
### Lessons
|
|
53
53
|
|
|
54
54
|
1. [Making](/test/courses/csintro/making)
|
|
55
|
-
2. [Algorithms](/test/courses/csintro/algorithms)
|
|
56
|
-
3. [Variables](/test/courses/csintro/variables)
|
|
55
|
+
2. [Algorithms](/test/courses/csintro/algorithms)
|
|
56
|
+
3. [Variables](/test/courses/csintro/variables)
|
|
57
57
|
4. [Conditionals](/test/courses/csintro/conditionals)
|
|
58
|
-
5. [Iteration](/test/courses/csintro/iteration)
|
|
58
|
+
5. [Iteration](/test/courses/csintro/iteration)
|
|
59
59
|
6. [Review/Mini-Project](/test/courses/csintro/miniproject)
|
|
60
60
|
7. [Coordinate grid system](/test/courses/csintro/coordinates)
|
|
61
61
|
8. [Booleans](/test/courses/csintro/booleans)
|
|
62
62
|
9. [Bits, bytes, and binary](/test/courses/csintro/binary)
|
|
63
63
|
10. [Radio](/test/courses/csintro/radio)
|
|
64
|
-
11. [
|
|
65
|
-
12. [
|
|
64
|
+
11. [Accelerometer](/test/courses/csintro/accelerometer)
|
|
65
|
+
12. [Arrays](/test/courses/csintro/arrays)
|
|
66
|
+
13. [Independent final project](/test/courses/csintro/finalproject)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pxt-microbit",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.14",
|
|
4
4
|
"description": "micro:bit target for Microsoft MakeCode (PXT)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"JavaScript",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"docs/static/icons/favicon.ico"
|
|
33
33
|
],
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@types/dom-mediacapture-record": "
|
|
35
|
+
"@types/dom-mediacapture-record": "1.0.20",
|
|
36
36
|
"@types/marked": "0.3.0",
|
|
37
37
|
"@types/node": "8.10.66",
|
|
38
38
|
"@types/react": "16.4.7",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"typescript": "4.8.3"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"pxt-common-packages": "12.
|
|
49
|
-
"pxt-core": "11.2.
|
|
48
|
+
"pxt-common-packages": "12.1.4",
|
|
49
|
+
"pxt-core": "11.2.24"
|
|
50
50
|
}
|
|
51
51
|
}
|
package/targetconfig.json
CHANGED
|
@@ -451,7 +451,7 @@
|
|
|
451
451
|
"bsiever/pxt-sen55": { "tags": [ "Science" ] },
|
|
452
452
|
"climate-action-kits/pxt-fwd-edu": {},
|
|
453
453
|
"elecfreaks/pxt-cutebot-pro": { "tags": [ "Robotics" ], "preferred": true },
|
|
454
|
-
"microbit-foundation/makecode-tutorials": {},
|
|
454
|
+
"microbit-foundation/makecode-tutorials": { "tutorial" : true },
|
|
455
455
|
"grandpabond/pxt-meter": { "tags": [ "Software" ] },
|
|
456
456
|
"microsoft/microbit-robot": { "tags": [ "Robotics" ] },
|
|
457
457
|
"4tronix/mars-rover": { "tags": [ "Robotics" ] },
|