batch fixing ](/microbit/ -> ](/ links
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Clear Screen
|
||||
|
||||
Turn off all the LED lights on the [LED screen](/microbit/device/screen).
|
||||
Turn off all the LED lights on the [LED screen](/device/screen).
|
||||
|
||||
```sig
|
||||
basic.clearScreen()
|
||||
@@ -23,9 +23,9 @@ basic.clearScreen()
|
||||
|
||||
### Lessons
|
||||
|
||||
[blink](/microbit/lessons/blink), [flashing heart](/microbit/lessons/flashing-heart), [screen wipe](/microbit/lessons/screen-wipe)
|
||||
[blink](/lessons/blink), [flashing heart](/lessons/flashing-heart), [screen wipe](/lessons/screen-wipe)
|
||||
|
||||
### See also
|
||||
|
||||
[set brightness](/microbit/reference/led/set-brightness), [unplot](/microbit/reference/led/unplot), [plot](/microbit/reference/led/plot), [Image](/microbit/reference/image/image), [clear](/microbit/reference/basic/clear-screen)
|
||||
[set brightness](/reference/led/set-brightness), [unplot](/reference/led/unplot), [plot](/reference/led/plot), [Image](/reference/image/image), [clear](/reference/basic/clear-screen)
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Forever
|
||||
|
||||
Repeat code [in the background](/microbit/reference/control/in-background) forever.
|
||||
Repeat code [in the background](/reference/control/in-background) forever.
|
||||
|
||||
```sig
|
||||
basic.forever(() => {
|
||||
@@ -9,7 +9,7 @@ basic.forever(() => {
|
||||
|
||||
### Example: compass
|
||||
|
||||
The following example constantly checks the [compass heading](/microbit/reference/input/compass-heading) and updates the screen with the direction.
|
||||
The following example constantly checks the [compass heading](/reference/input/compass-heading) and updates the screen with the direction.
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
@@ -57,9 +57,9 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
### Lessons
|
||||
|
||||
[blink](/microbit/lessons/blink), [bounce-image](/microbit/lessons/bounce-image), [snowflake-fall](/microbit/lessons/snowflake-fall), [flashing-heart](/microbit/lessons/flashing-heart)
|
||||
[blink](/lessons/blink), [bounce-image](/lessons/bounce-image), [snowflake-fall](/lessons/snowflake-fall), [flashing-heart](/lessons/flashing-heart)
|
||||
|
||||
### See also
|
||||
|
||||
[while](/microbit/js/while), [on button pressed](/microbit/reference/input/on-button-pressed), [in background](/microbit/reference/control/in-background)
|
||||
[while](/js/while), [on button pressed](/reference/input/on-button-pressed), [in background](/reference/control/in-background)
|
||||
|
||||
|
@@ -23,9 +23,9 @@ for (let i = 0; i < 5; i++) {
|
||||
|
||||
### Lessons
|
||||
|
||||
[blink](/microbit/lessons/blink), [lucky 7](/microbit/lessons/lucky-7), [smiley](/microbit/lessons/smiley), [flashing heart](/microbit/lessons/flashing-heart)
|
||||
[blink](/lessons/blink), [lucky 7](/lessons/lucky-7), [smiley](/lessons/smiley), [flashing heart](/lessons/flashing-heart)
|
||||
|
||||
### See also
|
||||
|
||||
[while](/microbit/js/while), [running time](/microbit/reference/input/running-time), [for](/microbit/reference/loops/for)
|
||||
[while](/js/while), [running time](/reference/input/running-time), [for](/reference/loops/for)
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Show Animation
|
||||
|
||||
Show a series of image frames on the [LED screen](/microbit/device/screen), pausing the specified time after each frame.
|
||||
Show a series of image frames on the [LED screen](/device/screen), pausing the specified time after each frame.
|
||||
|
||||
```sig
|
||||
basic.showAnimation(`
|
||||
@@ -14,8 +14,8 @@ basic.showAnimation(`
|
||||
|
||||
### Parameters
|
||||
|
||||
* `leds` - [String](/microbit/reference/types/string); a series of LED on/off states
|
||||
* `interval` - [Number](/microbit/reference/types/number); the number of milliseconds to pause after each image frame
|
||||
* `leds` - [String](/reference/types/string); a series of LED on/off states
|
||||
* `interval` - [Number](/reference/types/number); the number of milliseconds to pause after each image frame
|
||||
|
||||
### Show a series of image frames
|
||||
|
||||
@@ -51,11 +51,11 @@ basic.showAnimation(`
|
||||
|
||||
### ~hint
|
||||
|
||||
Use [forever](/microbit/reference/basic/forever) to continually repeat an animation
|
||||
Use [forever](/reference/basic/forever) to continually repeat an animation
|
||||
|
||||
### ~
|
||||
|
||||
### Lessons
|
||||
|
||||
[smiley](/microbit/lessons/smiley), [bounce image](/microbit/lessons/bounce-image), [snowflake fall](/microbit/lessons/snowflake-fall), [rotation animation](/microbit/lessons/rotation-animation)
|
||||
[smiley](/lessons/smiley), [bounce image](/lessons/bounce-image), [snowflake fall](/lessons/snowflake-fall), [rotation animation](/lessons/rotation-animation)
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Show LEDs
|
||||
|
||||
Display an image on the BBC micro:bit's [LED screen](/microbit/device/screen).
|
||||
Display an image on the BBC micro:bit's [LED screen](/device/screen).
|
||||
|
||||
```sig
|
||||
basic.showLeds(`
|
||||
@@ -16,7 +16,7 @@ basic.showLeds(`
|
||||
### Parameters
|
||||
|
||||
* ``leds`` - a series of LED on/off states that form an image (see steps below)
|
||||
* (optional) ``ms`` - [Number](/microbit/reference/types/number) - time to wait after displaying image. In blocks, ``ms`` is 400 by default.
|
||||
* (optional) ``ms`` - [Number](/reference/types/number) - time to wait after displaying image. In blocks, ``ms`` is 400 by default.
|
||||
|
||||
### Example - Block Editor
|
||||
|
||||
@@ -37,9 +37,9 @@ In JavaScript, the led off is represented by a `.` and the led on by a `#` chara
|
||||
|
||||
### Lessons
|
||||
|
||||
[smiley](/microbit/lessons/smiley), [flashing heart](/microbit/lessons/flashing-heart), [magic logo](/microbit/lessons/magic-logo)
|
||||
[smiley](/lessons/smiley), [flashing heart](/lessons/flashing-heart), [magic logo](/lessons/magic-logo)
|
||||
|
||||
### See also
|
||||
|
||||
[plot leds](/microbit/reference/led/plot-leds), [show animation](/microbit/reference/led/show-animation)
|
||||
[plot leds](/reference/led/plot-leds), [show animation](/reference/led/show-animation)
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Show Number
|
||||
|
||||
Show a number on the [LED screen](/microbit/device/screen), one digit at a time (scrolling from left to right)
|
||||
Show a number on the [LED screen](/device/screen), one digit at a time (scrolling from left to right)
|
||||
|
||||
~~~~sig
|
||||
basic.showNumber(2, 150)
|
||||
@@ -8,8 +8,8 @@ basic.showNumber(2, 150)
|
||||
|
||||
### Parameters
|
||||
|
||||
* value - a [Number](/microbit/reference/types/number)
|
||||
* (optional) interval (ms) - [Number](/microbit/reference/types/number); the time (in milliseconds) before scrolling by one LED; the larger the number, the slower the scroll
|
||||
* value - a [Number](/reference/types/number)
|
||||
* (optional) interval (ms) - [Number](/reference/types/number); the time (in milliseconds) before scrolling by one LED; the larger the number, the slower the scroll
|
||||
|
||||
### ~
|
||||
|
||||
@@ -28,7 +28,7 @@ basic.showNumber(x)
|
||||
|
||||
### Example: count to 5
|
||||
|
||||
This example uses a [for](/microbit/reference/loops/for) loop to show numbers ``1`` through ``5`` on the screen:
|
||||
This example uses a [for](/reference/loops/for) loop to show numbers ``1`` through ``5`` on the screen:
|
||||
|
||||
~~~~blocks
|
||||
for (let i = 0; i < 5; i++) {
|
||||
@@ -39,14 +39,14 @@ for (let i = 0; i < 5; i++) {
|
||||
|
||||
### Other show functions
|
||||
|
||||
* use [show string](/microbit/reference/basic/show-string) to show a string on the screen
|
||||
* use [show animation](/microbit/reference/basic/show-animation) to show a series of images on the screen
|
||||
* use [show string](/reference/basic/show-string) to show a string on the screen
|
||||
* use [show animation](/reference/basic/show-animation) to show a series of images on the screen
|
||||
|
||||
### Lessons
|
||||
|
||||
* [lucky 7](/microbit/lessons/lucky-7)
|
||||
* [lucky 7](/lessons/lucky-7)
|
||||
|
||||
### See also
|
||||
|
||||
[show string](/microbit/reference/basic/show-string), [show animation](/microbit/reference/basic/show-animation), [Number](/microbit/reference/types/number), [math library](/microbit/js/math)
|
||||
[show string](/reference/basic/show-string), [show animation](/reference/basic/show-animation), [Number](/reference/types/number), [math library](/js/math)
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Show String
|
||||
|
||||
Show a string on the [LED screen](/microbit/device/screen) one character at a time (scrolling from left to right).
|
||||
Show a string on the [LED screen](/device/screen) one character at a time (scrolling from left to right).
|
||||
|
||||
```sig
|
||||
basic.showString("Hello!")
|
||||
@@ -8,8 +8,8 @@ basic.showString("Hello!")
|
||||
|
||||
### Parameters
|
||||
|
||||
* `text` - a [String](/microbit/reference/types/string)
|
||||
* (optional) `ms` - [Number](/microbit/reference/types/number); the time (in milliseconds) before scrolling left by one LED; the larger the number, the slower the scroll
|
||||
* `text` - a [String](/reference/types/string)
|
||||
* (optional) `ms` - [Number](/reference/types/number); the time (in milliseconds) before scrolling left by one LED; the larger the number, the slower the scroll
|
||||
|
||||
### Examples:
|
||||
|
||||
@@ -28,14 +28,14 @@ basic.showString(s)
|
||||
|
||||
### Other show functions
|
||||
|
||||
* use [show number](/microbit/reference/basic/show-number) to show a number on the screen
|
||||
* use [show animation](/microbit/reference/basic/show-animation) to show a series of images on the screen
|
||||
* use [show number](/reference/basic/show-number) to show a number on the screen
|
||||
* use [show animation](/reference/basic/show-animation) to show a series of images on the screen
|
||||
|
||||
### Lessons
|
||||
|
||||
[answering machine](/microbit/lessons/answering-machine), [rock paper scissors](/microbit/lessons/rock-paper-scissors), [love meter](/microbit/lessons/love-meter), [digital pet](/microbit/lessons/digital-pet)
|
||||
[answering machine](/lessons/answering-machine), [rock paper scissors](/lessons/rock-paper-scissors), [love meter](/lessons/love-meter), [digital pet](/lessons/digital-pet)
|
||||
|
||||
### See also
|
||||
|
||||
[String](/microbit/reference/types/string), [string functions](/microbit/reference/types/string-functions), [show number](/microbit/reference/basic/show-number), [show animation](/microbit/reference/basic/show-animation)
|
||||
[String](/reference/types/string), [string functions](/reference/types/string-functions), [show number](/reference/basic/show-number), [show animation](/reference/basic/show-animation)
|
||||
|
||||
|
@@ -12,7 +12,7 @@ In the interval notation, the brackets "[" and "]" represent inclusive endpoints
|
||||
|
||||
### Block Editor for loop uses a 0-based inclusive interval
|
||||
|
||||
Numeric intervals arise in the context of for loops, both in the Block Editor and Touch Develop. Here's a Block Editor for loop to draw a diagonal line from the top-left corner of the [LED screen](/microbit/device/screen) to the bottom-right corner. The loop iteration variable *i* ranges "from 0 to 4":
|
||||
Numeric intervals arise in the context of for loops, both in the Block Editor and Touch Develop. Here's a Block Editor for loop to draw a diagonal line from the top-left corner of the [LED screen](/device/screen) to the bottom-right corner. The loop iteration variable *i* ranges "from 0 to 4":
|
||||
|
||||

|
||||
|
||||
|
@@ -12,7 +12,7 @@ Right click on any block and add a comment
|
||||
|
||||
### ~hint
|
||||
|
||||
To find out how to insert comments using the Blocks editor, see [the Blocks editor](/microbit/blocks/editor).
|
||||
To find out how to insert comments using the Blocks editor, see [the Blocks editor](/blocks/editor).
|
||||
|
||||
### ~
|
||||
|
||||
@@ -34,5 +34,5 @@ When you want to uncomment your code, right click the on the comment, and then c
|
||||
|
||||
### See also
|
||||
|
||||
[Block editor](/microbit/blocks/editor)
|
||||
[Block editor](/blocks/editor)
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# In Background
|
||||
|
||||
Run code in the background as a separate process or thread; for more information on this advanced construct, see [the micro:bit - a reactive system](/microbit/device/reactive).
|
||||
Run code in the background as a separate process or thread; for more information on this advanced construct, see [the micro:bit - a reactive system](/device/reactive).
|
||||
|
||||
```sig
|
||||
control.inBackground(() => {
|
||||
@@ -51,5 +51,5 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
### See also
|
||||
|
||||
[while](/microbit/reference/loops/while), [forever](/microbit/reference/basic/forever), [on button pressed](/microbit/reference/input/on-button-pressed)
|
||||
[while](/reference/loops/while), [forever](/reference/basic/forever), [on button pressed](/reference/input/on-button-pressed)
|
||||
|
||||
|
@@ -24,5 +24,5 @@ export function onGamepadButton(name: string, body:td.Action)
|
||||
|
||||
### See Also
|
||||
|
||||
[tell remote control to](/microbit/reference/devices/tell-remote-control-to), [raise alert to](/microbit/reference/devices/raise-alert-to), [on notified](/microbit/reference/devices/on-notified), [signal strength](/microbit/reference/devices/signal-strength), [on signal strength changed](/microbit/reference/devices/on-signal-strength-changed)
|
||||
[tell remote control to](/reference/devices/tell-remote-control-to), [raise alert to](/reference/devices/raise-alert-to), [on notified](/reference/devices/on-notified), [signal strength](/reference/devices/signal-strength), [on signal strength changed](/reference/devices/on-signal-strength-changed)
|
||||
|
||||
|
@@ -36,5 +36,5 @@ devices.onSignalStrengthChanged(() => {
|
||||
|
||||
### See Also
|
||||
|
||||
[tell remote control to](/microbit/reference/devices/tell-remote-control-to), [raise alert to](/microbit/reference/devices/raise-alert-to), [on notified](/microbit/reference/devices/on-notified), [signal strength](/microbit/reference/devices/signal-strength)
|
||||
[tell remote control to](/reference/devices/tell-remote-control-to), [raise alert to](/reference/devices/raise-alert-to), [on notified](/reference/devices/on-notified), [signal strength](/reference/devices/signal-strength)
|
||||
|
||||
|
@@ -64,5 +64,5 @@ devices.raiseAlertTo("ring alarm")
|
||||
|
||||
### See also
|
||||
|
||||
[tell remote control to](/microbit/reference/devices/tell-remote-control-to), [tell camera to](/microbit/reference/devices/tell-camera-to), [on notified](/microbit/reference/devices/on-notified)
|
||||
[tell remote control to](/reference/devices/tell-remote-control-to), [tell camera to](/reference/devices/tell-camera-to), [on notified](/reference/devices/on-notified)
|
||||
|
||||
|
@@ -38,5 +38,5 @@ radio.onDataReceived(() => {
|
||||
|
||||
### See also
|
||||
|
||||
[send number](/microbit/reference/radio/send-number), [receive number](/microbit/reference/radio/receive-number), [on data received](/microbit/reference/radio/on-data-received), [set group](/microbit/reference/radio/set-group)
|
||||
[send number](/reference/radio/send-number), [receive number](/reference/radio/receive-number), [on data received](/reference/radio/on-data-received), [set group](/reference/radio/set-group)
|
||||
|
||||
|
@@ -36,5 +36,5 @@ devices.onSignalStrengthChanged(() => {
|
||||
|
||||
### See Also
|
||||
|
||||
[tell remote control to](/microbit/reference/devices/tell-remote-control-to), [raise alert to](/microbit/reference/devices/raise-alert-to), [on notified](/microbit/reference/devices/on-notified), [on signal strength changed](/microbit/reference/devices/on-signal-strength-changed)
|
||||
[tell remote control to](/reference/devices/tell-remote-control-to), [raise alert to](/reference/devices/raise-alert-to), [on notified](/reference/devices/on-notified), [on signal strength changed](/reference/devices/on-signal-strength-changed)
|
||||
|
||||
|
@@ -76,5 +76,5 @@ devices.tellCameraTo("stop video mode")
|
||||
|
||||
### See Also
|
||||
|
||||
[tell remote control to](/microbit/reference/devices/tell-remote-control-to), [raise alert to](/microbit/reference/devices/raise-alert-to), [on notified](/microbit/reference/devices/on-notified)
|
||||
[tell remote control to](/reference/devices/tell-remote-control-to), [raise alert to](/reference/devices/raise-alert-to), [on notified](/reference/devices/on-notified)
|
||||
|
||||
|
@@ -48,11 +48,11 @@ antenna.tellMicrophoneTo("stop capture")
|
||||
|
||||
### Other show functions
|
||||
|
||||
* use [tell remote control to](/microbit/reference/devices/tell-remote-control-to) to control presentation of media content
|
||||
* use [tell camera to](/microbit/reference/devices/tell-camera-to) to control the photo/video recording of connected devices
|
||||
* use [raise alert to](/microbit/reference/devices/raise-alert-to) to control the microphone of connected devices
|
||||
* use [tell remote control to](/reference/devices/tell-remote-control-to) to control presentation of media content
|
||||
* use [tell camera to](/reference/devices/tell-camera-to) to control the photo/video recording of connected devices
|
||||
* use [raise alert to](/reference/devices/raise-alert-to) to control the microphone of connected devices
|
||||
|
||||
### See also
|
||||
|
||||
[Antenna](/microbit/js/antenna)
|
||||
[Antenna](/js/antenna)
|
||||
|
||||
|
@@ -88,5 +88,5 @@ devices.tellRemoteControlTo("volume down")
|
||||
|
||||
### See also
|
||||
|
||||
[tell camera to](/microbit/reference/devices/tell-camera-to), [raise alert to](/microbit/reference/devices/raise-alert-to), [on notified](/microbit/reference/devices/on-notified)
|
||||
[tell camera to](/reference/devices/tell-camera-to), [raise alert to](/reference/devices/raise-alert-to), [on notified](/reference/devices/on-notified)
|
||||
|
||||
|
@@ -39,5 +39,5 @@ export function score() : number
|
||||
|
||||
### Lessons
|
||||
|
||||
[bop it](/microbit/lessons/bop-it) | [game of chance](/microbit/lessons/game-of-chance) | [game counter](/microbit/lessons/game-counter)
|
||||
[bop it](/lessons/bop-it) | [game of chance](/lessons/game-of-chance) | [game counter](/lessons/game-counter)
|
||||
|
||||
|
@@ -26,5 +26,5 @@ export function changeYBy(_this: micro_bitSprites.LedSprite, y: number)
|
||||
|
||||
### Lessons
|
||||
|
||||
[game of chance](/microbit/lessons/game-of-chance) | [game counter](/microbit/lessons/game-counter)
|
||||
[game of chance](/lessons/game-of-chance) | [game counter](/lessons/game-counter)
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
The clear function for images.
|
||||
|
||||
Turn off all the pixels in an [Image](/microbit/reference/image/image).
|
||||
Turn off all the pixels in an [Image](/reference/image/image).
|
||||
|
||||
### KindScript
|
||||
|
||||
@@ -35,5 +35,5 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
### See also
|
||||
|
||||
[Image](/microbit/reference/image/image), [show animation](/microbit/reference/basic/show-animation), [show image](/microbit/reference/images/show-image), [scroll image](/microbit/reference/images/scroll-image), [create image](/microbit/reference/images/create-image)
|
||||
[Image](/reference/image/image), [show animation](/reference/basic/show-animation), [show image](/reference/images/show-image), [scroll image](/reference/images/scroll-image), [create image](/reference/images/create-image)
|
||||
|
||||
|
@@ -19,7 +19,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
game.startCountdown(10000)
|
||||
```
|
||||
|
||||
### [Create sprite](/microbit/functions/game-library/create-sprite)
|
||||
### [Create sprite](/functions/game-library/create-sprite)
|
||||
|
||||
Create sprite with x, y coordinates and returns a LED Sprite. Create a new LED sprite.
|
||||
|
||||
@@ -29,7 +29,7 @@ Create sprite with x, y coordinates and returns a LED Sprite. Create a new LED s
|
||||
export function createSprite(x: number, y: number) : micro_bitSprites.LedSprite
|
||||
```
|
||||
|
||||
### [Move](/microbit/functions/game-library/move)
|
||||
### [Move](/functions/game-library/move)
|
||||
|
||||
Sprite move by a certain number
|
||||
|
||||
@@ -39,7 +39,7 @@ Sprite move by a certain number
|
||||
export function move(_this: micro_bitSprites.LedSprite, leds: number)
|
||||
```
|
||||
|
||||
### [Turn](/microbit/functions/game-library/turn)
|
||||
### [Turn](/functions/game-library/turn)
|
||||
|
||||
Rotates a sprite to the right by a certain number of degrees
|
||||
|
||||
@@ -55,7 +55,7 @@ Rotates a sprite to the left by a certain number of degrees
|
||||
export function turnLeft(_this: micro_bitSprites.LedSprite, degrees: number)
|
||||
```
|
||||
|
||||
### [Change](/microbit/functions/game-library/change)
|
||||
### [Change](/functions/game-library/change)
|
||||
|
||||
Sprite will change the x position by this number
|
||||
|
||||
@@ -71,7 +71,7 @@ Sprite will change the y position by this number
|
||||
export function changeYBy(_this: micro_bitSprites.LedSprite, y: number)
|
||||
```
|
||||
|
||||
### [Set](/microbit/functions/game-library/set)
|
||||
### [Set](/functions/game-library/set)
|
||||
|
||||
Sprite will change the x position by this number
|
||||
|
||||
@@ -87,7 +87,7 @@ Sprite will change the y position by this number
|
||||
export function changeYBy(_this: micro_bitSprites.LedSprite, y: number)
|
||||
```
|
||||
|
||||
### [If on edge, bounce](/microbit/functions/game-library/if-on-edge-bounce)
|
||||
### [If on edge, bounce](/functions/game-library/if-on-edge-bounce)
|
||||
|
||||
Sprite - If the sprite is on the edge, the sprite will bounce
|
||||
|
||||
@@ -97,7 +97,7 @@ Sprite - If the sprite is on the edge, the sprite will bounce
|
||||
export function ifOnEdge_Bounce(_this: micro_bitSprites.LedSprite)
|
||||
```
|
||||
|
||||
### [Change score by](/microbit/functions/game-library/change-score-by)
|
||||
### [Change score by](/functions/game-library/change-score-by)
|
||||
|
||||
When a player achieves a goal, you can increase the game score
|
||||
|
||||
@@ -109,7 +109,7 @@ When a player achieves a goal, you can increase the game score
|
||||
export function addScore(points: number)
|
||||
```
|
||||
|
||||
### [Score](/microbit/functions/game-library/score)
|
||||
### [Score](/functions/game-library/score)
|
||||
|
||||
* set the current score to a particular value.
|
||||
|
||||
@@ -125,7 +125,7 @@ export function setScore(value: number)
|
||||
export function score() : number
|
||||
```
|
||||
|
||||
### [Countdown](/microbit/functions/game-library/start-countdown)
|
||||
### [Countdown](/functions/game-library/start-countdown)
|
||||
|
||||
If your game has a time limit, you can start a countdown in which case `game->current time` returns the remaining time.
|
||||
|
||||
@@ -137,7 +137,7 @@ If your game has a time limit, you can start a countdown in which case `game->cu
|
||||
export function startCountdown(ms: number)
|
||||
```
|
||||
|
||||
### [Game over](/microbit/functions/game-library/game-over)
|
||||
### [Game over](/functions/game-library/game-over)
|
||||
|
||||
If the `life` reaches zero or the time expires (see countdown), the game enters the **game over** mode. When the game is over, `game->is running` returns false
|
||||
|
||||
@@ -157,5 +157,5 @@ game.gameOver()
|
||||
|
||||
### Lessons
|
||||
|
||||
[game of chance](/microbit/lessons/game-of-chance) | [game counter](/microbit/lessons/game-counter)
|
||||
[game of chance](/lessons/game-of-chance) | [game counter](/lessons/game-counter)
|
||||
|
||||
|
@@ -20,5 +20,5 @@ game.gameOver()
|
||||
|
||||
### Lessons
|
||||
|
||||
[game of chance](/microbit/lessons/game-of-chance)
|
||||
[game of chance](/lessons/game-of-chance)
|
||||
|
||||
|
@@ -18,5 +18,5 @@ export function move(_this: micro_bitSprites.LedSprite, leds: number)
|
||||
|
||||
### Lessons
|
||||
|
||||
[game of chance](/microbit/lessons/game-of-chance) | [game counter](/microbit/lessons/game-counter)
|
||||
[game of chance](/lessons/game-of-chance) | [game counter](/lessons/game-counter)
|
||||
|
||||
|
@@ -28,5 +28,5 @@ export function y(_this: micro_bitSprites.LedSprite) : number
|
||||
|
||||
### Lessons
|
||||
|
||||
[game of chance](/microbit/lessons/game-of-chance) | [game counter](/microbit/lessons/game-counter)
|
||||
[game of chance](/lessons/game-of-chance) | [game counter](/lessons/game-counter)
|
||||
|
||||
|
@@ -52,5 +52,5 @@ export function direction(_this: micro_bitSprites.LedSprite) : number
|
||||
|
||||
### Lessons
|
||||
|
||||
[game of chance](/microbit/lessons/game-of-chance) | [game counter](/microbit/lessons/game-counter)
|
||||
[game of chance](/lessons/game-of-chance) | [game counter](/lessons/game-counter)
|
||||
|
||||
|
@@ -55,5 +55,5 @@ export function startCountdown(ms: number)
|
||||
|
||||
### Lessons
|
||||
|
||||
[bop it](/microbit/lessons/bop-it) | [game of chance](/microbit/lessons/game-of-chance) | [game counter](/microbit/lessons/game-counter)
|
||||
[bop it](/lessons/bop-it) | [game of chance](/lessons/game-of-chance) | [game counter](/lessons/game-counter)
|
||||
|
||||
|
@@ -53,5 +53,5 @@ export function startCountdown(ms: number)
|
||||
|
||||
### Lessons
|
||||
|
||||
[bop it](/microbit/lessons/bop-it) | [game of chance](/microbit/lessons/game-of-chance) | [game counter](/microbit/lessons/game-counter)
|
||||
[bop it](/lessons/bop-it) | [game of chance](/lessons/game-of-chance) | [game counter](/lessons/game-counter)
|
||||
|
||||
|
@@ -20,5 +20,5 @@ export function isTouching(_this: micro_bitSprites.LedSprite, other: micro_bitSp
|
||||
|
||||
### Lessons
|
||||
|
||||
[game of chance](/microbit/lessons/game-of-chance) | [game counter](/microbit/lessons/game-counter)
|
||||
[game of chance](/lessons/game-of-chance) | [game counter](/lessons/game-counter)
|
||||
|
||||
|
@@ -26,5 +26,5 @@ export function turnLeft(_this: micro_bitSprites.LedSprite, degrees: number)
|
||||
|
||||
### Lessons
|
||||
|
||||
[game of chance](/microbit/lessons/game-of-chance) | [game counter](/microbit/lessons/game-counter)
|
||||
[game of chance](/lessons/game-of-chance) | [game counter](/lessons/game-counter)
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Create Image
|
||||
|
||||
Create an [Image](/microbit/reference/image/image) to show on the [LED screen](/microbit/device/screen).
|
||||
Create an [Image](/reference/image/image) to show on the [LED screen](/device/screen).
|
||||
|
||||
```sig
|
||||
images.createImage(`
|
||||
@@ -31,9 +31,9 @@ input.onGesture(Gesture.Shake, () => {
|
||||
|
||||
### Lessons
|
||||
|
||||
[rock paper scissors](/microbit/lessons/rock-paper-scissors), [digital pet](/microbit/lessons/digital-pet), [offset-image](/microbit/lessons/offset-image)
|
||||
[rock paper scissors](/lessons/rock-paper-scissors), [digital pet](/lessons/digital-pet), [offset-image](/lessons/offset-image)
|
||||
|
||||
### See also
|
||||
|
||||
[show animation](/microbit/reference/basic/show-animation), [image](/microbit/reference/image/image), [show image](/microbit/reference/image/show-image), [scroll image](/microbit/reference/image/scroll-image)
|
||||
[show animation](/reference/basic/show-animation), [image](/reference/image/image), [show image](/reference/image/show-image), [scroll image](/reference/image/scroll-image)
|
||||
|
||||
|
@@ -4,11 +4,11 @@ An image for the micro:bit screen.
|
||||
|
||||
### @parent blocks/language
|
||||
|
||||
An *Image* is a matrix of pixels to show on the [LED screen](/microbit/device/screen)
|
||||
An *Image* is a matrix of pixels to show on the [LED screen](/device/screen)
|
||||
|
||||
### Block Editor: Show LEDs
|
||||
|
||||
To display an image using the [Block Editor](/microbit/blocks/editor):
|
||||
To display an image using the [Block Editor](/blocks/editor):
|
||||
|
||||
* click `Basic` , `Show LEDs`, and tap on the LEDs`
|
||||
* when you're done, return to your code
|
||||
@@ -19,11 +19,11 @@ You should see code similar to this:
|
||||
|
||||
### Creating an image
|
||||
|
||||
To create an image that you can later modify, see the [create image](/microbit/reference/images/create-image) function.
|
||||
To create an image that you can later modify, see the [create image](/reference/images/create-image) function.
|
||||
|
||||
### Block editor: create and show images
|
||||
|
||||
To create images using the [Block editor](/microbit/blocks/editor):
|
||||
To create images using the [Block editor](/blocks/editor):
|
||||
|
||||
1. Click the **Images** category on the left.
|
||||
|
||||
@@ -39,18 +39,18 @@ You should see code similar to this:
|
||||
|
||||
### Image functions
|
||||
|
||||
* [create image](/microbit/reference/images/create-image): create an image from a series of on/off LED states
|
||||
* [clear](/microbit/reference/basic/clear-screen): turn off all the pixels in an image
|
||||
* [pixel](/microbit/reference/images/pixel): get the state of a pixel in an image
|
||||
* [show-leds](/microbit/reference/basic/show-leds): show a single-frame image on the LED screen
|
||||
* [show image](/microbit/reference/images/show-image): show an image on the screen
|
||||
* [scroll image](/microbit/reference/images/scroll-image): scroll an image on the screen
|
||||
* [create image](/reference/images/create-image): create an image from a series of on/off LED states
|
||||
* [clear](/reference/basic/clear-screen): turn off all the pixels in an image
|
||||
* [pixel](/reference/images/pixel): get the state of a pixel in an image
|
||||
* [show-leds](/reference/basic/show-leds): show a single-frame image on the LED screen
|
||||
* [show image](/reference/images/show-image): show an image on the screen
|
||||
* [scroll image](/reference/images/scroll-image): scroll an image on the screen
|
||||
|
||||
### Lessons
|
||||
|
||||
* [smiley](/microbit/lessons/smiley)
|
||||
* [smiley](/lessons/smiley)
|
||||
|
||||
### See also
|
||||
|
||||
[Show LEDs](/microbit/reference/basic/show-leds), [create image](/microbit/reference/images/create-image), [show image](/microbit/reference/images/show-image), [LED screen](/microbit/device/screen)
|
||||
[Show LEDs](/reference/basic/show-leds), [create image](/reference/images/create-image), [show image](/reference/images/show-image), [LED screen](/device/screen)
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
The pixel function.
|
||||
|
||||
Get the state of a pixel in an [Image](/microbit/reference/image/image).
|
||||
Get the state of a pixel in an [Image](/reference/image/image).
|
||||
|
||||
### KindScript
|
||||
|
||||
@@ -12,16 +12,16 @@ export function pixel(_this: micro_bit.Image, x: number, y: number) : boolean
|
||||
|
||||
### Parameters
|
||||
|
||||
* x - [Number](/microbit/reference/types/number); the *x coordinate* or horizontal position of a pixel in an [image](/microbit/reference/image/image)
|
||||
* y - [Number](/microbit/reference/types/number); the *y coordinate* or vertical position of a pixel in an [image](/microbit/reference/image/image)
|
||||
* x - [Number](/reference/types/number); the *x coordinate* or horizontal position of a pixel in an [image](/reference/image/image)
|
||||
* y - [Number](/reference/types/number); the *y coordinate* or vertical position of a pixel in an [image](/reference/image/image)
|
||||
|
||||
### x, y coordinates?
|
||||
|
||||
To figure out the ``x``, ``y`` coordinates, see [LED screen](/microbit/device/screen).
|
||||
To figure out the ``x``, ``y`` coordinates, see [LED screen](/device/screen).
|
||||
|
||||
### Returns
|
||||
|
||||
* [Boolean](/microbit/reference/types/boolean) - `true` for on and `false` for off
|
||||
* [Boolean](/reference/types/boolean) - `true` for on and `false` for off
|
||||
|
||||
### Example
|
||||
|
||||
@@ -47,5 +47,5 @@ let state = img.pixel(0, 0)
|
||||
|
||||
### See also
|
||||
|
||||
[set pixel](/microbit/reference/images/set-pixel), [show image](/microbit/reference/images/show-image), [image](/microbit/reference/image/image), [create image](/microbit/reference/images/create-image), [scroll image](/microbit/reference/images/scroll-image)
|
||||
[set pixel](/reference/images/set-pixel), [show image](/reference/images/show-image), [image](/reference/image/image), [create image](/reference/images/create-image), [scroll image](/reference/images/scroll-image)
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
The plot frame function.
|
||||
|
||||
Display an [Image](/microbit/reference/image/image) on the BBC micro:bit's [LED screen](/microbit/device/screen)
|
||||
Display an [Image](/reference/image/image) on the BBC micro:bit's [LED screen](/device/screen)
|
||||
|
||||
### KindScript
|
||||
|
||||
@@ -12,7 +12,7 @@ export function plotFrame(_this: micro_bit.Image, index: number)
|
||||
|
||||
### Parameters
|
||||
|
||||
* index - [Number](/microbit/reference/types/number); which frame of the image to display
|
||||
* index - [Number](/reference/types/number); which frame of the image to display
|
||||
|
||||
### Difference from `plot image`
|
||||
|
||||
@@ -33,9 +33,9 @@ img.plotFrame(1)
|
||||
|
||||
### Lessons
|
||||
|
||||
[smiley](/microbit/lessons/smiley), [flashing heart](/microbit/lessons/flashing-heart), [magic logo](/microbit/lessons/magic-logo)
|
||||
[smiley](/lessons/smiley), [flashing heart](/lessons/flashing-heart), [magic logo](/lessons/magic-logo)
|
||||
|
||||
### See also
|
||||
|
||||
[create image](/microbit/reference/images/create-image), [show animation](/microbit/reference/basic/show-animation), [image](/microbit/reference/image/image), [show image](/microbit/reference/images/show-image), [scroll image](/microbit/reference/images/scroll-image)
|
||||
[create image](/reference/images/create-image), [show animation](/reference/basic/show-animation), [image](/reference/image/image), [show image](/reference/images/show-image), [scroll image](/reference/images/scroll-image)
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
The plot image function.
|
||||
|
||||
Display an [Image](/microbit/reference/image/image) on the BBC micro:bit's [LED screen](/microbit/device/screen)
|
||||
Display an [Image](/reference/image/image) on the BBC micro:bit's [LED screen](/device/screen)
|
||||
|
||||
### KindScript
|
||||
|
||||
@@ -12,7 +12,7 @@ export function plotImage(_this: micro_bit.Image, xOffset: number)
|
||||
|
||||
### Parameters
|
||||
|
||||
* x offset - [Number](/microbit/reference/types/number); the horizontal starting point of an image; use 0 for the first frame of the image, 5 for the second frame of the image, 10 for the third frame and so on.
|
||||
* x offset - [Number](/reference/types/number); the horizontal starting point of an image; use 0 for the first frame of the image, 5 for the second frame of the image, 10 for the third frame and so on.
|
||||
|
||||
### Difference from `show image`
|
||||
|
||||
@@ -33,9 +33,9 @@ img.plotImage(0)
|
||||
|
||||
### Lessons
|
||||
|
||||
[smiley](/microbit/lessons/smiley), [flashing heart](/microbit/lessons/flashing-heart), [magic logo](/microbit/lessons/magic-logo)
|
||||
[smiley](/lessons/smiley), [flashing heart](/lessons/flashing-heart), [magic logo](/lessons/magic-logo)
|
||||
|
||||
### See also
|
||||
|
||||
[create image](/microbit/reference/images/create-image), [show animation](/microbit/reference/basic/show-animation), [image](/microbit/reference/image/image), [show image](/microbit/reference/images/show-image), [scroll image](/microbit/reference/images/scroll-image)
|
||||
[create image](/reference/images/create-image), [show animation](/reference/basic/show-animation), [image](/reference/image/image), [show image](/reference/images/show-image), [scroll image](/reference/images/scroll-image)
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
The scroll image function.
|
||||
|
||||
Scrolls the frames within an [Image](/microbit/reference/image/image) on the [LED screen](/microbit/device/screen).
|
||||
Scrolls the frames within an [Image](/reference/image/image) on the [LED screen](/device/screen).
|
||||
|
||||
### Block Editor
|
||||
|
||||
@@ -16,8 +16,8 @@ export function scrollImage(_this: micro_bit.Image, xOffsetPerStep: number, inte
|
||||
|
||||
### Parameters
|
||||
|
||||
* x offset per step : [Number](/microbit/reference/types/number) - the number of columns to scroll at a time (horizontal offset). Use a positive number to scroll an image to the right and a negative number to scroll left. To jump from one image frame to the next, use an offset of 5 or -5.
|
||||
* interval (ms) : [Number](/microbit/reference/types/number) - the time (in milliseconds) before scrolling by `x offset per step`; the larger the number, the slower the scroll.
|
||||
* x offset per step : [Number](/reference/types/number) - the number of columns to scroll at a time (horizontal offset). Use a positive number to scroll an image to the right and a negative number to scroll left. To jump from one image frame to the next, use an offset of 5 or -5.
|
||||
* interval (ms) : [Number](/reference/types/number) - the time (in milliseconds) before scrolling by `x offset per step`; the larger the number, the slower the scroll.
|
||||
|
||||
### ~hide
|
||||
|
||||
@@ -69,5 +69,5 @@ img.scrollImage(5, 1000)
|
||||
|
||||
### See also
|
||||
|
||||
[show image](/microbit/reference/images/show-image), [image](/microbit/reference/image/image), [create image](/microbit/reference/images/create-image), [show animation](/microbit/reference/basic/show-animation)
|
||||
[show image](/reference/images/show-image), [image](/reference/image/image), [create image](/reference/images/create-image), [show animation](/reference/basic/show-animation)
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
The set pixel function. #set pixel.
|
||||
|
||||
Set the on/off state of pixel in an [Image](/microbit/reference/image/image).
|
||||
Set the on/off state of pixel in an [Image](/reference/image/image).
|
||||
|
||||
### KindScript
|
||||
|
||||
@@ -12,13 +12,13 @@ export function setPixel(_this: micro_bit.Image, x: number, y: number, value: bo
|
||||
|
||||
### Parameters
|
||||
|
||||
* x - [Number](/microbit/reference/types/number); the *x coordinate* or horizontal position of a pixel in an [image](/microbit/reference/image/image)
|
||||
* x - [Number](/microbit/reference/types/number); the *y coordinate* or vertical position of a pixel in an [image](/microbit/reference/image/image)
|
||||
* value -[Boolean](/microbit/reference/types/boolean); the on/off state of a pixel; `true` for on, `false` for off
|
||||
* x - [Number](/reference/types/number); the *x coordinate* or horizontal position of a pixel in an [image](/reference/image/image)
|
||||
* x - [Number](/reference/types/number); the *y coordinate* or vertical position of a pixel in an [image](/reference/image/image)
|
||||
* value -[Boolean](/reference/types/boolean); the on/off state of a pixel; `true` for on, `false` for off
|
||||
|
||||
### x, y coordinates?
|
||||
|
||||
To figure out the ``x``, ``y`` coordinates, see [LED screen](/microbit/device/screen).
|
||||
To figure out the ``x``, ``y`` coordinates, see [LED screen](/device/screen).
|
||||
|
||||
### Example
|
||||
|
||||
@@ -38,5 +38,5 @@ img.showImage(0)
|
||||
|
||||
### See also
|
||||
|
||||
[pixel](/microbit/reference/images/pixel), [show image](/microbit/reference/images/show-image), [image](/microbit/reference/image/image), [create image](/microbit/reference/images/create-image), [scroll image](/microbit/reference/images/scroll-image)
|
||||
[pixel](/reference/images/pixel), [show image](/reference/images/show-image), [image](/reference/image/image), [create image](/reference/images/create-image), [scroll image](/reference/images/scroll-image)
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
The show frame function.
|
||||
|
||||
Display an [Image](/microbit/reference/image/image) on the BBC micro:bit's [LED screen](/microbit/device/screen)
|
||||
Display an [Image](/reference/image/image) on the BBC micro:bit's [LED screen](/device/screen)
|
||||
|
||||
### KindScript
|
||||
|
||||
@@ -12,11 +12,11 @@ export function showFrame(img: micro_bit.Image, frame: number)
|
||||
|
||||
### Parameters
|
||||
|
||||
* index - [Number](/microbit/reference/types/number); which frame of the image to display
|
||||
* index - [Number](/reference/types/number); which frame of the image to display
|
||||
|
||||
### Difference from `plot frame`
|
||||
|
||||
The `show frame` function is the same as [plot frame](/microbit/reference/image/plot-frame), but contains a built-in delay after the LED screen has been updated (whereas `plot frame` has no built-in delay)
|
||||
The `show frame` function is the same as [plot frame](/reference/image/plot-frame), but contains a built-in delay after the LED screen has been updated (whereas `plot frame` has no built-in delay)
|
||||
|
||||
### Example
|
||||
|
||||
@@ -33,9 +33,9 @@ img.showFrame(1)
|
||||
|
||||
### Lessons
|
||||
|
||||
[smiley](/microbit/lessons/smiley), [flashing heart](/microbit/lessons/flashing-heart), [magic logo](/microbit/lessons/magic-logo)
|
||||
[smiley](/lessons/smiley), [flashing heart](/lessons/flashing-heart), [magic logo](/lessons/magic-logo)
|
||||
|
||||
### See also
|
||||
|
||||
[create image](/microbit/reference/images/create-image), [show animation](/microbit/reference/basic/show-animation), [image](/microbit/reference/image/image), [show image](/microbit/reference/images/show-image), [scroll image](/microbit/reference/images/scroll-image)
|
||||
[create image](/reference/images/create-image), [show animation](/reference/basic/show-animation), [image](/reference/image/image), [show image](/reference/images/show-image), [scroll image](/reference/images/scroll-image)
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
The show image function.
|
||||
|
||||
Show an [Image](/microbit/reference/image/image) on the [LED screen](/microbit/device/screen), followed by a 400ms pause.
|
||||
Show an [Image](/reference/image/image) on the [LED screen](/device/screen), followed by a 400ms pause.
|
||||
|
||||
### Block Editor
|
||||
|
||||
@@ -16,11 +16,11 @@ export function showImage(_this: micro_bit.Image, xOffset: number)
|
||||
|
||||
### Parameters
|
||||
|
||||
* x offset - [Number](/microbit/reference/types/number); the horizontal starting point of an image; use 0 for the first frame of the image, 5 for the second frame of the image, 10 for the third frame and so on.
|
||||
* x offset - [Number](/reference/types/number); the horizontal starting point of an image; use 0 for the first frame of the image, 5 for the second frame of the image, 10 for the third frame and so on.
|
||||
|
||||
### Create image and show image
|
||||
|
||||
Use the [image editor](/microbit/reference/image/image) to create images using the [create image](/microbit/reference/image/create-image) function, and then use `show image` like this:
|
||||
Use the [image editor](/reference/image/image) to create images using the [create image](/reference/image/create-image) function, and then use `show image` like this:
|
||||
|
||||
```
|
||||
let img = images.createImage(`
|
||||
@@ -35,7 +35,7 @@ img.showImage(0)
|
||||
|
||||
### Example: display numbers 1-5
|
||||
|
||||
The following example creates an image with 5 frames and then uses a [for loop](/microbit/reference/loops/for) to show each frame on the screen:
|
||||
The following example creates an image with 5 frames and then uses a [for loop](/reference/loops/for) to show each frame on the screen:
|
||||
|
||||
```
|
||||
let img2 = images.createImage(`
|
||||
@@ -53,9 +53,9 @@ for (let i = 0; i < 5; i++) {
|
||||
|
||||
### Lessons
|
||||
|
||||
[rock paper scissors](/microbit/lessons/rock-paper-scissors), [digital pet](/microbit/lessons/digital-pet), [offset-image](/microbit/lessons/offset-image)
|
||||
[rock paper scissors](/lessons/rock-paper-scissors), [digital pet](/lessons/digital-pet), [offset-image](/lessons/offset-image)
|
||||
|
||||
### See also
|
||||
|
||||
[show animation](/microbit/reference/basic/show-animation), [image](/microbit/reference/image/image), [create image](/microbit/reference/images/create-image), [scroll image](/microbit/reference/images/scroll-image)
|
||||
[show animation](/reference/basic/show-animation), [image](/reference/image/image), [create image](/reference/images/create-image), [scroll image](/reference/images/scroll-image)
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
The width function.
|
||||
|
||||
Get the width of an [Image](/microbit/reference/image/image) in columns.
|
||||
Get the width of an [Image](/reference/image/image) in columns.
|
||||
|
||||
### KindScript
|
||||
|
||||
@@ -16,7 +16,7 @@ export function width(_this: micro_bit.Image) : number
|
||||
|
||||
### Returns
|
||||
|
||||
* [Number](/microbit/reference/types/number) - the number of columns in a image. This function returns 5 if the image has 1 frame, 10 for 2 frames, 15 for 3 frames and so on. Divide the number of columns by 5 to find out how many frames an image has (see example below).
|
||||
* [Number](/reference/types/number) - the number of columns in a image. This function returns 5 if the image has 1 frame, 10 for 2 frames, 15 for 3 frames and so on. Divide the number of columns by 5 to find out how many frames an image has (see example below).
|
||||
|
||||
The following example gets the width of `img` and stores it in the `w` variable:
|
||||
|
||||
@@ -40,7 +40,7 @@ let w = img.width()
|
||||
|
||||
### Example: show each frame
|
||||
|
||||
The following example uses the `width` function with a [for](/microbit/reference/loops/for) loop to show each image frame on the screen:
|
||||
The following example uses the `width` function with a [for](/reference/loops/for) loop to show each image frame on the screen:
|
||||
|
||||
```
|
||||
let img2 = images.createImage(`
|
||||
@@ -58,5 +58,5 @@ for (let i = 0; i < img2.width() / 5; i++) {
|
||||
|
||||
### See also
|
||||
|
||||
[show image](/microbit/reference/images/show-image), [image](/microbit/reference/image/image), [create image](/microbit/reference/images/create-image), [scroll image](/microbit/reference/images/scroll-image), [show animation](/microbit/reference/basic/show-animation)
|
||||
[show image](/reference/images/show-image), [image](/reference/image/image), [create image](/reference/images/create-image), [scroll image](/reference/images/scroll-image), [show animation](/reference/basic/show-animation)
|
||||
|
||||
|
@@ -8,11 +8,11 @@ input.acceleration(Dimension.X);
|
||||
|
||||
### Parameters
|
||||
|
||||
* dimension : [String](/microbit/reference/types/string) - one of three values specifying the axis of acceleration: ``x`` (left/right); ``y`` (forward/backwards); ``z`` (up/down)
|
||||
* dimension : [String](/reference/types/string) - one of three values specifying the axis of acceleration: ``x`` (left/right); ``y`` (forward/backwards); ``z`` (up/down)
|
||||
|
||||
### Returns
|
||||
|
||||
* [Number](/microbit/reference/types/number) - acceleration, in milli-gravities. When the micro:bit is laying flat with the screen up, x=0, y=0 and z=-1023.
|
||||
* [Number](/reference/types/number) - acceleration, in milli-gravities. When the micro:bit is laying flat with the screen up, x=0, y=0 and z=-1023.
|
||||
|
||||
### Example: bar chart
|
||||
|
||||
@@ -41,9 +41,9 @@ basic.forever(() => {
|
||||
|
||||
### Lessons
|
||||
|
||||
[zoomer](/microbit/lessons/zoomer)
|
||||
[zoomer](/lessons/zoomer)
|
||||
|
||||
### See also
|
||||
|
||||
[compass-heading](/microbit/input/compass-heading), [lightlevel](/microbit/input/lightlevel)
|
||||
[compass-heading](/input/compass-heading), [lightlevel](/input/lightlevel)
|
||||
|
||||
|
@@ -8,15 +8,15 @@ input.buttonIsPressed(Button.A);
|
||||
|
||||
### Parameters
|
||||
|
||||
* name - [String](/microbit/reference/types/string); input button "A", "B", or "A+B" (both input buttons)
|
||||
* name - [String](/reference/types/string); input button "A", "B", or "A+B" (both input buttons)
|
||||
|
||||
### Returns
|
||||
|
||||
* [Boolean](/microbit/reference/types/boolean) - `true` if pressed, `false` if not pressed
|
||||
* [Boolean](/reference/types/boolean) - `true` if pressed, `false` if not pressed
|
||||
|
||||
### Example
|
||||
|
||||
The following code uses an [if](/microbit/reference/logic/if) statement to run code, depending on whether or not the A button is pressed:
|
||||
The following code uses an [if](/reference/logic/if) statement to run code, depending on whether or not the A button is pressed:
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
@@ -33,9 +33,9 @@ basic.forever(() => {
|
||||
|
||||
### Lessons
|
||||
|
||||
[zoomer](/microbit/lessons/zoomer)
|
||||
[zoomer](/lessons/zoomer)
|
||||
|
||||
### See also
|
||||
|
||||
[on button pressed](/microbit/input/on-button-pressed), [if](/microbit/reference/logic/if), [forever](/microbit/basic/forever)
|
||||
[on button pressed](/input/on-button-pressed), [if](/reference/logic/if), [forever](/basic/forever)
|
||||
|
||||
|
@@ -8,7 +8,7 @@ input.compassHeading();
|
||||
|
||||
### Returns
|
||||
|
||||
* [Number](/microbit/reference/types/number) - the heading in degrees (0 to 360 degrees). If the compass is calibrating, it returns ``-1003``.
|
||||
* [Number](/reference/types/number) - the heading in degrees (0 to 360 degrees). If the compass is calibrating, it returns ``-1003``.
|
||||
|
||||
## Simulator
|
||||
|
||||
@@ -55,9 +55,9 @@ During calibration, ``compass heading`` returns ``-1003``.
|
||||
|
||||
### Lessons
|
||||
|
||||
[compass](/microbit/lessons/compass)
|
||||
[compass](/lessons/compass)
|
||||
|
||||
### See also
|
||||
|
||||
[acceleration](/microbit/reference/input/acceleration)
|
||||
[acceleration](/reference/input/acceleration)
|
||||
|
||||
|
@@ -10,7 +10,7 @@ input.lightLevel();
|
||||
|
||||
### Returns
|
||||
|
||||
* [Number](/microbit/reference/types/number) - light level from ``0`` (dark) to ``255`` (bright).
|
||||
* [Number](/reference/types/number) - light level from ``0`` (dark) to ``255`` (bright).
|
||||
|
||||
### Example: chart light level
|
||||
|
||||
@@ -26,5 +26,5 @@ basic.forever(() => {
|
||||
|
||||
### See also
|
||||
|
||||
[acceleration](/microbit/reference/input/acceleration), [compass-heading](/microbit/input/compass-heading)
|
||||
[acceleration](/reference/input/acceleration), [compass-heading](/input/compass-heading)
|
||||
|
||||
|
@@ -8,11 +8,11 @@ input.magneticForce(Dimension.X);
|
||||
|
||||
### Parameters
|
||||
|
||||
* dimension : [String](/microbit/reference/types/string) - one of three values specifying the axis of the force: ``x`` (left/right); ``y`` (forward/backwards); ``z`` (up/down); ``strength`` (the length of the vector)
|
||||
* dimension : [String](/reference/types/string) - one of three values specifying the axis of the force: ``x`` (left/right); ``y`` (forward/backwards); ``z`` (up/down); ``strength`` (the length of the vector)
|
||||
|
||||
### Returns
|
||||
|
||||
* [Number](/microbit/reference/types/number) - magnetic force, in micro-Teslas.
|
||||
* [Number](/reference/types/number) - magnetic force, in micro-Teslas.
|
||||
|
||||
### Example: metal detector
|
||||
|
||||
@@ -28,5 +28,5 @@ basic.forever(() => {
|
||||
|
||||
### See also
|
||||
|
||||
[compass heading](/microbit/input/compass-heading)
|
||||
[compass heading](/input/compass-heading)
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# On Button Pressed
|
||||
|
||||
Register an [event handler](/microbit/reference/event-handler) that will execute whenever an input button (A, B, or A and B together) is pressed during program execution. When [running code](/microbit/js/simulator) with this function in a web browser, click an on-screen input button - labelled A or B.
|
||||
Register an [event handler](/reference/event-handler) that will execute whenever an input button (A, B, or A and B together) is pressed during program execution. When [running code](/js/simulator) with this function in a web browser, click an on-screen input button - labelled A or B.
|
||||
|
||||
```sig
|
||||
input.onButtonPressed(Button.A, () => {})
|
||||
@@ -32,9 +32,9 @@ input.onButtonPressed(Button.B, () => {
|
||||
|
||||
### Lessons
|
||||
|
||||
[smiley](/microbit/lessons/smiley), [answering machine](/microbit/lessons/answering-machine), [screen wipe](/microbit/lessons/screen-wipe), [rotation animation](/microbit/lessons/rotation-animation)
|
||||
[smiley](/lessons/smiley), [answering machine](/lessons/answering-machine), [screen wipe](/lessons/screen-wipe), [rotation animation](/lessons/rotation-animation)
|
||||
|
||||
### See also
|
||||
|
||||
[button is pressed](/microbit/reference/input/button-is-pressed), [forever](/microbit/reference/basic/forever)
|
||||
[button is pressed](/reference/input/button-is-pressed), [forever](/reference/basic/forever)
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# On Gesture
|
||||
|
||||
Register an [event handler](/microbit/reference/event-handler) that will execute whenever the user executes a gesture withthe BBC micro:bit.
|
||||
Register an [event handler](/reference/event-handler) that will execute whenever the user executes a gesture withthe BBC micro:bit.
|
||||
|
||||
```sig
|
||||
input.onGesture(Gesture.Shake,() => {
|
||||
@@ -41,5 +41,5 @@ input.onGesture(Gesture.Shake,() => {
|
||||
|
||||
### Lessons
|
||||
|
||||
[bounce image](/microbit/lessons/bounce-image), [rock paper scissors](/microbit/lessons/rock-paper-scissors)
|
||||
[bounce image](/lessons/bounce-image), [rock paper scissors](/lessons/rock-paper-scissors)
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# On Pin Pressed
|
||||
|
||||
Register an [event handler](/microbit/reference/event-handler) that will execute whenever the user holds the `GND` pin with one hand, and presses pin `0`, `1`, or `2` with the other hand, thus completing a circuit; when you run a script with this function in a web browser, click pins 0 , 1, or 2 on the simulator.
|
||||
Register an [event handler](/reference/event-handler) that will execute whenever the user holds the `GND` pin with one hand, and presses pin `0`, `1`, or `2` with the other hand, thus completing a circuit; when you run a script with this function in a web browser, click pins 0 , 1, or 2 on the simulator.
|
||||
|
||||
*Note* that this function works best when the BBC micro:bit is powered by AAA battery.
|
||||
|
||||
@@ -24,9 +24,9 @@ input.onPinPressed(TouchPin.P0, () => {
|
||||
|
||||
### Lessons
|
||||
|
||||
[love meter](/microbit/lessons/love-meter)
|
||||
[love meter](/lessons/love-meter)
|
||||
|
||||
### See also
|
||||
|
||||
[BBC micro:bit pins](/microbit/device/pins), [pin is pressed](/microbit/input/pin-is-pressed), [analog read pin](/microbit/pins/analog-read-pin), [analog write pin](/microbit/pins/analog-write-pin), [digital read pin](/microbit/pins/digital-read-pin), [digital write pin](/microbit/pins/digital-write-pin)
|
||||
[BBC micro:bit pins](/device/pins), [pin is pressed](/input/pin-is-pressed), [analog read pin](/pins/analog-read-pin), [analog write pin](/pins/analog-write-pin), [digital read pin](/pins/digital-read-pin), [digital write pin](/pins/digital-write-pin)
|
||||
|
||||
|
@@ -10,11 +10,11 @@ input.pinIsPressed(TouchPin.P0);
|
||||
|
||||
### Parameters
|
||||
|
||||
* name - [String](/microbit/reference/types/string); the pin name ("P0", "P1", or "P2")
|
||||
* name - [String](/reference/types/string); the pin name ("P0", "P1", or "P2")
|
||||
|
||||
### returns
|
||||
|
||||
* [Boolean](/microbit/reference/types/boolean) - `true` if pressed, `false` if not pressed
|
||||
* [Boolean](/reference/types/boolean) - `true` if pressed, `false` if not pressed
|
||||
|
||||
### Example
|
||||
|
||||
@@ -32,5 +32,5 @@ basic.forever(() => {
|
||||
|
||||
### See also
|
||||
|
||||
[BBC micro:bit pins](/microbit/device/pins), [on pin pressed](/microbit/input/on-pin-pressed), [analog read pin](/microbit/reference/pins/analog-read-pin), [analog write pin](/microbit/reference/pins/analog-write-pin), [digital read pin](/microbit/reference/pins/digital-read-pin), [digital write pin](/microbit/reference/pins/digital-write-pin)
|
||||
[BBC micro:bit pins](/device/pins), [on pin pressed](/input/on-pin-pressed), [analog read pin](/reference/pins/analog-read-pin), [analog write pin](/reference/pins/analog-write-pin), [digital read pin](/reference/pins/digital-read-pin), [digital write pin](/reference/pins/digital-write-pin)
|
||||
|
||||
|
@@ -8,11 +8,11 @@ input.rotation(Rotation.Roll);
|
||||
|
||||
### Parameters
|
||||
|
||||
* kind: [String](/microbit/reference/types/string) - one of values specifying the kind of rotation: ``pitch`` (up/down around the ``x`` axis); ``roll`` (left/right around the ``y`` axis)
|
||||
* kind: [String](/reference/types/string) - one of values specifying the kind of rotation: ``pitch`` (up/down around the ``x`` axis); ``roll`` (left/right around the ``y`` axis)
|
||||
|
||||
### Returns
|
||||
|
||||
* [Number](/microbit/reference/types/number) - angle, in degrees.
|
||||
* [Number](/reference/types/number) - angle, in degrees.
|
||||
|
||||
### Example: micro:bit leveller
|
||||
|
||||
@@ -44,5 +44,5 @@ basic.forever(() => {
|
||||
|
||||
### See also
|
||||
|
||||
[acceleration](/microbit/reference/input/acceleration), [compass-heading](/microbit/reference/input/compass-heading)
|
||||
[acceleration](/reference/input/acceleration), [compass-heading](/reference/input/compass-heading)
|
||||
|
||||
|
@@ -8,7 +8,7 @@ input.runningTime();
|
||||
|
||||
### Returns
|
||||
|
||||
* [Number](/microbit/reference/types/number)
|
||||
* [Number](/reference/types/number)
|
||||
|
||||
### Example: elapsed time
|
||||
|
||||
@@ -21,9 +21,9 @@ basic.showNumber(now)
|
||||
|
||||
### Lessons
|
||||
|
||||
[speed button](/microbit/lessons/speed-button)
|
||||
[speed button](/lessons/speed-button)
|
||||
|
||||
### See also
|
||||
|
||||
[show number](/microbit/reference/basic/show-number), [pause](/microbit/reference/basic/pause)
|
||||
[show number](/reference/basic/show-number), [pause](/reference/basic/pause)
|
||||
|
||||
|
@@ -8,11 +8,11 @@ input.temperature();
|
||||
|
||||
### Returns
|
||||
|
||||
* [Number](/microbit/reference/types/number) - temperature in degree Celsius °C.
|
||||
* [Number](/reference/types/number) - temperature in degree Celsius °C.
|
||||
|
||||
### How does it work?
|
||||
|
||||
The BBC micro:bit does not have a dedicated temperature sensor. Instead, the temperature provided is actually the temperature of the silicon die on the main CPU. As the processor generally runs cold though (it is a high efficiency ARM core), the temperature is a good approximation of the ambient temperature... you might warm up if you give the processor a lot of work to do though, and don't [sleep](/microbit/reference/basic/pause)!
|
||||
The BBC micro:bit does not have a dedicated temperature sensor. Instead, the temperature provided is actually the temperature of the silicon die on the main CPU. As the processor generally runs cold though (it is a high efficiency ARM core), the temperature is a good approximation of the ambient temperature... you might warm up if you give the processor a lot of work to do though, and don't [sleep](/reference/basic/pause)!
|
||||
|
||||
The temperature sensor has a high precision, but isn't trimmed for accuracy. In other words, it can sense changes in temperature very well, but there may be (and probably is) base line offset. i.e. it might return 20 degrees when it's actually 17, but it would return 21 when it is 18 etc.
|
||||
|
||||
@@ -31,5 +31,5 @@ basic.forever(() => {
|
||||
|
||||
### See also
|
||||
|
||||
[compass-heading](/microbit/reference/input/compass-heading), [acceleration](/microbit/reference/input/acceleration)
|
||||
[compass-heading](/reference/input/compass-heading), [acceleration](/reference/input/acceleration)
|
||||
|
||||
|
@@ -13,11 +13,11 @@ Set or change the value of a variable
|
||||
|
||||
### Touch Develop
|
||||
|
||||
Use the assignment operator (:=) to set or change the value of a [local variable](/microbit/reference/variables/var) or a [global variable](/microbit/js/data).
|
||||
Use the assignment operator (:=) to set or change the value of a [local variable](/reference/variables/var) or a [global variable](/js/data).
|
||||
|
||||
### Declare a variable
|
||||
|
||||
Declare a new *local* variable using the [var](/microbit/reference/variables/var) statement and the assignment operator (`:=`). Like this:
|
||||
Declare a new *local* variable using the [var](/reference/variables/var) statement and the assignment operator (`:=`). Like this:
|
||||
|
||||
```blocks
|
||||
let num1 = 7
|
||||
@@ -28,7 +28,7 @@ The variable's name is on the left of the assignment operator (`:=`) and the var
|
||||
|
||||
*variable name* `:=` *value*
|
||||
|
||||
See [global variable](/microbit/js/data) for info on declaring a global variable.
|
||||
See [global variable](/js/data) for info on declaring a global variable.
|
||||
|
||||
### Change a variable
|
||||
|
||||
@@ -42,13 +42,13 @@ num1 = 42
|
||||
### Notes
|
||||
|
||||
* Don't confuse the assignment operator `:=` with the equality operator `=`, which is used to compare values.
|
||||
* You can use the assignment operator `:=` with variables of each of the supported [types](/microbit/js/types).
|
||||
* You can use the assignment operator `:=` with variables of each of the supported [types](/js/types).
|
||||
|
||||
### Lessons
|
||||
|
||||
[counter](/microbit/lessons/counter), [rotation animation](/microbit/lessons/rotation-animation), [digital pet](/microbit/lessons/digital-pet), [offset image](/microbit/lessons/offset-image)
|
||||
[counter](/lessons/counter), [rotation animation](/lessons/rotation-animation), [digital pet](/lessons/digital-pet), [offset image](/lessons/offset-image)
|
||||
|
||||
### See also
|
||||
|
||||
[local variables](/microbit/reference/variables/var), [global variables](/microbit/js/data), [types](/microbit/js/types)
|
||||
[local variables](/reference/variables/var), [global variables](/js/data), [types](/js/types)
|
||||
|
||||
|
@@ -6,18 +6,18 @@ Functions in the Bits library.
|
||||
|
||||
The binary numeral system represents numeric values using values 0 and 1. This is how almost all modern computers store data. Each 0 or 1 digit is called a binary digit, or bit for short.
|
||||
|
||||
The Bits library includes functions for bit-level manipulation of integers. In the [Touch Develop editor](/microbit/js/editor), click `bits` to see the following bit functions:
|
||||
The Bits library includes functions for bit-level manipulation of integers. In the [Touch Develop editor](/js/editor), click `bits` to see the following bit functions:
|
||||
|
||||
## Bitwise and, or, and xor functions
|
||||
|
||||
#### Syntax
|
||||
|
||||
bits `->` *and/or/xor* uint32 (x : [Number](/microbit/reference/types/number), y : [Number](/microbit/reference/types/number)) *returns* [Number](/microbit/reference/types/number)
|
||||
bits `->` *and/or/xor* uint32 (x : [Number](/reference/types/number), y : [Number](/reference/types/number)) *returns* [Number](/reference/types/number)
|
||||
|
||||
#### Parameters
|
||||
|
||||
* x - an unsigned 32 bit integer [Number](/microbit/reference/types/number)
|
||||
* y - another unsigned 32 bit integer [Number](/microbit/reference/types/number)
|
||||
* x - an unsigned 32 bit integer [Number](/reference/types/number)
|
||||
* y - another unsigned 32 bit integer [Number](/reference/types/number)
|
||||
|
||||
### and uint32
|
||||
|
||||
@@ -37,14 +37,14 @@ Rotate bits to the left or the right, by the specified number of positions.
|
||||
|
||||
#### Syntax
|
||||
|
||||
bits `->` rotate left unint32 (x : [Number](/microbit/reference/types/number), bits : [Number](/microbit/reference/types/number)) *returns* [Number](/microbit/reference/types/number)
|
||||
bits `->` rotate left unint32 (x : [Number](/reference/types/number), bits : [Number](/reference/types/number)) *returns* [Number](/reference/types/number)
|
||||
|
||||
bits `->` rotate right unint32 (x : [Number](/microbit/reference/types/number), bits : [Number](/microbit/reference/types/number)) *returns* [Number](/microbit/reference/types/number)
|
||||
bits `->` rotate right unint32 (x : [Number](/reference/types/number), bits : [Number](/reference/types/number)) *returns* [Number](/reference/types/number)
|
||||
|
||||
#### Parameters
|
||||
|
||||
* x - [Number](/microbit/reference/types/number);
|
||||
* bits - [Number](/microbit/reference/types/number);
|
||||
* x - [Number](/reference/types/number);
|
||||
* bits - [Number](/reference/types/number);
|
||||
|
||||
## Shift left and shift right
|
||||
|
||||
@@ -52,16 +52,16 @@ Shift bits to the left or the right, by the specified number of positions.
|
||||
|
||||
#### Syntax
|
||||
|
||||
bits `->` shift left unint32 (x : [Number](/microbit/reference/types/number), bits : [Number](/microbit/reference/types/number)) *returns* [Number](/microbit/reference/types/number)
|
||||
bits `->` shift left unint32 (x : [Number](/reference/types/number), bits : [Number](/reference/types/number)) *returns* [Number](/reference/types/number)
|
||||
|
||||
bits `->` shift right unint32 (x : [Number](/microbit/reference/types/number), bits : [Number](/microbit/reference/types/number)) *returns* [Number](/microbit/reference/types/number)
|
||||
bits `->` shift right unint32 (x : [Number](/reference/types/number), bits : [Number](/reference/types/number)) *returns* [Number](/reference/types/number)
|
||||
|
||||
#### Parameters
|
||||
|
||||
* x - [Number](/microbit/reference/types/number);
|
||||
* bits - [Number](/microbit/reference/types/number);
|
||||
* x - [Number](/reference/types/number);
|
||||
* bits - [Number](/reference/types/number);
|
||||
|
||||
### See also
|
||||
|
||||
[statements and operators](/microbit/js/statements), [math functions](/microbit/js/math), [Number](/microbit/reference/types/number)
|
||||
[statements and operators](/js/statements), [math functions](/js/math), [Number](/reference/types/number)
|
||||
|
||||
|
@@ -4,7 +4,7 @@ true or false.
|
||||
|
||||
### @parent js/language
|
||||
|
||||
A Boolean has one of two possible values: `true`; `false`. Boolean (logical) operators (*and*, *or*, *not*) take Boolean inputs and yields a Boolean value. Comparison operators on other types ([numbers](/microbit/reference/types/number), [strings](/microbit/reference/types/string)) yields a Boolean value.
|
||||
A Boolean has one of two possible values: `true`; `false`. Boolean (logical) operators (*and*, *or*, *not*) take Boolean inputs and yields a Boolean value. Comparison operators on other types ([numbers](/reference/types/number), [strings](/reference/types/string)) yields a Boolean value.
|
||||
|
||||
### Block Editor
|
||||
|
||||
@@ -16,7 +16,7 @@ The next three blocks represent the three Boolean (logic) operators:
|
||||
|
||||

|
||||
|
||||
The next six blocks represent comparison operators that yield a Boolean value. Most comparisons you will do involve [numbers](/microbit/reference/types/number):
|
||||
The next six blocks represent comparison operators that yield a Boolean value. Most comparisons you will do involve [numbers](/reference/types/number):
|
||||
|
||||

|
||||
|
||||
@@ -31,7 +31,7 @@ let condition2 = true
|
||||
|
||||
### ~
|
||||
|
||||
Boolean values and operators are often used with an [if](/microbit/reference/logic/if) or [while](/microbit/js/while) statement to determine which code will execute next. For example:
|
||||
Boolean values and operators are often used with an [if](/reference/logic/if) or [while](/js/while) statement to determine which code will execute next. For example:
|
||||
|
||||
```
|
||||
if (condition && condition2) {
|
||||
@@ -110,13 +110,13 @@ if (x < 5) {
|
||||
}
|
||||
```
|
||||
|
||||
See the documentation on [Numbers](/microbit/reference/types/number) for more information on comparing two Numbers. You can also [compare strings](/microbit/reference/types/string-functions) using the `equals` function.
|
||||
See the documentation on [Numbers](/reference/types/number) for more information on comparing two Numbers. You can also [compare strings](/reference/types/string-functions) using the `equals` function.
|
||||
|
||||
### Lessons
|
||||
|
||||
[rotation animation](/microbit/lessons/rotation-animation), [digi yoyo](/microbit/lessons/digi-yoyo), [love meter](/microbit/lessons/love-meter), [zoomer](/microbit/lessons/zoomer)
|
||||
[rotation animation](/lessons/rotation-animation), [digi yoyo](/lessons/digi-yoyo), [love meter](/lessons/love-meter), [zoomer](/lessons/zoomer)
|
||||
|
||||
### See also
|
||||
|
||||
[if](/microbit/reference/logic/if), [while](/microbit/js/while), [number](/microbit/reference/types/number)
|
||||
[if](/reference/logic/if), [while](/js/while), [number](/reference/types/number)
|
||||
|
||||
|
@@ -5,7 +5,7 @@ Break statement; exit a for or while loop.
|
||||
### @parent js/language
|
||||
|
||||
|
||||
Exit a [while](/microbit/js/while) or [for](/microbit/reference/loops/for) loop before the loop is complete.
|
||||
Exit a [while](/js/while) or [for](/reference/loops/for) loop before the loop is complete.
|
||||
|
||||
### Touch Develop syntax
|
||||
|
||||
@@ -29,9 +29,9 @@ for (let i = 0; i < 10; i++) {
|
||||
|
||||
### Lessons
|
||||
|
||||
[jailbreak](/microbit/lessons/jailbreak)
|
||||
[jailbreak](/lessons/jailbreak)
|
||||
|
||||
### See also
|
||||
|
||||
[for](/microbit/reference/loops/for), [while](/microbit/js/while)
|
||||
[for](/reference/loops/for), [while](/js/while)
|
||||
|
||||
|
@@ -5,11 +5,11 @@ How to call a function in your code.
|
||||
### @parent js/language
|
||||
|
||||
|
||||
Type a function name in your code to call an existing [function](/microbit/js/function) in your script.
|
||||
Type a function name in your code to call an existing [function](/js/function) in your script.
|
||||
|
||||
### Call a function
|
||||
|
||||
1. In the Touch Develop editor, click a line of code to open the on-screen [Code Keyboard](/microbit/js/editor).
|
||||
1. In the Touch Develop editor, click a line of code to open the on-screen [Code Keyboard](/js/editor).
|
||||
|
||||
2. Click `code` to see the functions in your script.
|
||||
|
||||
@@ -19,7 +19,7 @@ Type a function name in your code to call an existing [function](/microbit/js/fu
|
||||
|
||||
### Example: the square function
|
||||
|
||||
Here's a function called `square`, with a [Number](/microbit/reference/types/number) input parameter:
|
||||
Here's a function called `square`, with a [Number](/reference/types/number) input parameter:
|
||||
|
||||
```
|
||||
/**
|
||||
@@ -59,5 +59,5 @@ To see a list of the functions in a script, open the script and then click `scri
|
||||
|
||||
### See also
|
||||
|
||||
[function parameters](/microbit/js/functionparameters), [create a function](/microbit/js/function), [return statement](/microbit/js/return)
|
||||
[function parameters](/js/functionparameters), [create a function](/js/function), [return statement](/js/return)
|
||||
|
||||
|
@@ -9,7 +9,7 @@ To add a **functions** to your script, click the `script` button, then click the
|
||||
|
||||
### functions
|
||||
|
||||
A **function** takes [inputs](/microbit/actionparameters), runs code and (optionally) returns an output.
|
||||
A **function** takes [inputs](/actionparameters), runs code and (optionally) returns an output.
|
||||
|
||||
TouchDevelop functions are similar to `mathematical functions`. Consider the function that computes the square of `x`: `square(x) = x*x`. In code, it would look like this:
|
||||
|
||||
@@ -27,5 +27,5 @@ An function can be marked as **private** in the properties. A private function i
|
||||
|
||||
### documentation
|
||||
|
||||
The comment(s) at the beginning of a function used to provide a description of its purpose. This text will show in the help area when the function is called from the code editor. This is particularly useful for [libraries](/microbit/libraries).
|
||||
The comment(s) at the beginning of a function used to provide a description of its purpose. This text will show in the help area when the function is called from the code editor. This is particularly useful for [libraries](/libraries).
|
||||
|
||||
|
@@ -23,7 +23,7 @@ To insert a comment in a Touch Develop script:
|
||||
|
||||
### ~hint
|
||||
|
||||
To find out how to insert comments using the Blocks editor, see [the Blocks editor](/microbit/blocks/editor).
|
||||
To find out how to insert comments using the Blocks editor, see [the Blocks editor](/blocks/editor).
|
||||
|
||||
### ~
|
||||
|
||||
@@ -46,7 +46,7 @@ export function square(x: number) : number {
|
||||
|
||||
### Formatting
|
||||
|
||||
Use [markdown syntax](/microbit/js/markdown) to format your comments (for example, **bold** and *italic* formatting).
|
||||
Use [markdown syntax](/js/markdown) to format your comments (for example, **bold** and *italic* formatting).
|
||||
|
||||
### Commenting out code
|
||||
|
||||
@@ -58,7 +58,7 @@ To comment out a block of code:
|
||||
|
||||
2. Press and hold the Shift key, and then press the Down arrow key to select a block of code.
|
||||
|
||||
3. In the block editing window, scroll down to **surround with** and click `comment out`. This adds an [if](/microbit/reference/logic/if) statement around your code, like this:
|
||||
3. In the block editing window, scroll down to **surround with** and click `comment out`. This adds an [if](/reference/logic/if) statement around your code, like this:
|
||||
|
||||
```
|
||||
if (false) {
|
||||
@@ -70,10 +70,10 @@ When you want to uncomment your code, click the `if false then` statement in you
|
||||
|
||||
### Library and function comments
|
||||
|
||||
* Use [comments](/microbit/js/comment) at the beginning of a library to describe the library
|
||||
* Use [comments](/microbit/js/comment) at the beginning of a [function](/microbit/js/function) to describe a function. The comment will appear in the help area of the Touch Develop editor when you insert the function
|
||||
* Use [comments](/js/comment) at the beginning of a library to describe the library
|
||||
* Use [comments](/js/comment) at the beginning of a [function](/js/function) to describe a function. The comment will appear in the help area of the Touch Develop editor when you insert the function
|
||||
|
||||
### See also
|
||||
|
||||
[markdown syntax](/microbit/js/markdown), [Touch Develop editor](/microbit/js/editor), [Block editor](/microbit/blocks/editor)
|
||||
[markdown syntax](/js/markdown), [Touch Develop editor](/js/editor), [Block editor](/blocks/editor)
|
||||
|
||||
|
@@ -16,9 +16,9 @@ JavaScript docs for the micro:bit
|
||||
|
||||
Welcome to the Touch Develop home page for the BBC micro:bit. Below you will find resources about the Touch Develop programming language and code editor. Good places to start include:
|
||||
|
||||
* [the Touch Develop Editor](/microbit/js/editor)
|
||||
* [30+ BBC micro:bit lessons](/microbit/lessonss)
|
||||
* [offline support](/microbit/offline)
|
||||
* [the Touch Develop Editor](/js/editor)
|
||||
* [30+ BBC micro:bit lessons](/lessonss)
|
||||
* [offline support](/offline)
|
||||
|
||||
### ~column
|
||||
|
||||
@@ -26,67 +26,67 @@ Welcome to the Touch Develop home page for the BBC micro:bit. Below you will fin
|
||||
|
||||
### Variables
|
||||
|
||||
* [local variables](/microbit/reference/variables/var)
|
||||
* [global variables ](/microbit/js/data)
|
||||
* [local variables](/reference/variables/var)
|
||||
* [global variables ](/js/data)
|
||||
|
||||
### Types
|
||||
|
||||
* [Number](/microbit/reference/types/number)
|
||||
* [Boolean](/microbit/reference/types/boolean)
|
||||
* [String](/microbit/reference/types/string)
|
||||
* [Image](/microbit/reference/image/image)
|
||||
* [Number](/reference/types/number)
|
||||
* [Boolean](/reference/types/boolean)
|
||||
* [String](/reference/types/string)
|
||||
* [Image](/reference/image/image)
|
||||
|
||||
### Statements and control structures
|
||||
|
||||
* [assignment operator](/microbit/reference/variables/assign) `:=`
|
||||
* [if](/microbit/reference/logic/if)
|
||||
* [for](/microbit/reference/loops/for)
|
||||
* [while](/microbit/js/while)
|
||||
* [break](/microbit/js/break)
|
||||
* [forever](/microbit/reference/basic/forever)
|
||||
* [in background](/microbit/reference/control/in-background)
|
||||
* [function](/microbit/js/function)
|
||||
* [return](/microbit/js/return)
|
||||
* [assignment operator](/reference/variables/assign) `:=`
|
||||
* [if](/reference/logic/if)
|
||||
* [for](/reference/loops/for)
|
||||
* [while](/js/while)
|
||||
* [break](/js/break)
|
||||
* [forever](/reference/basic/forever)
|
||||
* [in background](/reference/control/in-background)
|
||||
* [function](/js/function)
|
||||
* [return](/js/return)
|
||||
|
||||
### Maths
|
||||
|
||||
* arithmetic operators (`+`, `-`, `*`, `/`, mod) on [Numbers](/microbit/reference/types/number)
|
||||
* comparison operators (such as `>`, `=`) on [Numbers](/microbit/reference/types/number)
|
||||
* the [math](/microbit/js/math) library
|
||||
* the [bits](/microbit/js/bits) library
|
||||
* arithmetic operators (`+`, `-`, `*`, `/`, mod) on [Numbers](/reference/types/number)
|
||||
* comparison operators (such as `>`, `=`) on [Numbers](/reference/types/number)
|
||||
* the [math](/js/math) library
|
||||
* the [bits](/js/bits) library
|
||||
|
||||
### Logical
|
||||
|
||||
* [Boolean](/microbit/reference/types/boolean) values `true` and `false`
|
||||
* Operations (`not`, `or`, `and`) on [Booleans](/microbit/reference/types/boolean)
|
||||
* [Boolean](/reference/types/boolean) values `true` and `false`
|
||||
* Operations (`not`, `or`, `and`) on [Booleans](/reference/types/boolean)
|
||||
|
||||
### Strings
|
||||
|
||||
* [string functions](/microbit/reference/types/string-functions)
|
||||
* [string functions](/reference/types/string-functions)
|
||||
|
||||
### Functions
|
||||
|
||||
* [create a function](/microbit/js/function)
|
||||
* [function parameters](/microbit/js/functionparameters)
|
||||
* [call a function](/microbit/js/call)
|
||||
* [create a function](/js/function)
|
||||
* [function parameters](/js/functionparameters)
|
||||
* [call a function](/js/call)
|
||||
|
||||
### Collections
|
||||
|
||||
* read the [collections tutorial](/microbit/js/collections)
|
||||
* read the [collections tutorial](/js/collections)
|
||||
|
||||
### Custom object types
|
||||
|
||||
* see the [object types tutorial](/microbit/js/object-types)
|
||||
* read the [object disclaimer](/microbit/js/object-disclaimer) if you're an advanced user
|
||||
* see the [object types tutorial](/js/object-types)
|
||||
* read the [object disclaimer](/js/object-disclaimer) if you're an advanced user
|
||||
|
||||
### Libraries
|
||||
|
||||
* [create and use libraries](/microbit/js/libraries)
|
||||
* [create and use libraries](/js/libraries)
|
||||
|
||||
### Documentation
|
||||
|
||||
* [comments](/microbit/js/comment)
|
||||
* [markdown syntax](/microbit/js/markdown)
|
||||
* [comments](/js/comment)
|
||||
* [markdown syntax](/js/markdown)
|
||||
|
||||
### ~
|
||||
|
||||
@@ -96,97 +96,97 @@ Welcome to the Touch Develop home page for the BBC micro:bit. Below you will fin
|
||||
|
||||
### Basic
|
||||
|
||||
* [clear screen](/microbit/reference/basic/clear-screen)
|
||||
* [forever](/microbit/reference/basic/forever)
|
||||
* [pause](/microbit/reference/basic/pause)
|
||||
* [show leds](/microbit/reference/basic/show-leds)
|
||||
* [show animation](/microbit/reference/basic/show-animation)
|
||||
* [show number](/microbit/reference/basic/show-number)
|
||||
* [show string](/microbit/reference/basic/show-string)
|
||||
* [clear screen](/reference/basic/clear-screen)
|
||||
* [forever](/reference/basic/forever)
|
||||
* [pause](/reference/basic/pause)
|
||||
* [show leds](/reference/basic/show-leds)
|
||||
* [show animation](/reference/basic/show-animation)
|
||||
* [show number](/reference/basic/show-number)
|
||||
* [show string](/reference/basic/show-string)
|
||||
|
||||
### LED
|
||||
|
||||
* [brightness](/microbit/reference/led/brightness)
|
||||
* [fade in](/microbit/reference/led/fade-in)
|
||||
* [fade out](/microbit/reference/led/fade-out)
|
||||
* [plot](/microbit/reference/led/plot)
|
||||
* [plot all](/microbit/reference/led/plot-all)
|
||||
* [point](/microbit/reference/led/point)
|
||||
* [screenshot](/microbit/functions/screenshot)
|
||||
* [set display mode](/microbit/functions/set-display-mode)
|
||||
* [set brightness](/microbit/reference/led/set-brightness)
|
||||
* [stop animation](/microbit/reference/led/stop-animation)
|
||||
* [toggle](/microbit/reference/led/toggle)
|
||||
* [toggle all](/microbit/reference/led/toggle-all)
|
||||
* [unplot](/microbit/reference/led/unplot)
|
||||
* [brightness](/reference/led/brightness)
|
||||
* [fade in](/reference/led/fade-in)
|
||||
* [fade out](/reference/led/fade-out)
|
||||
* [plot](/reference/led/plot)
|
||||
* [plot all](/reference/led/plot-all)
|
||||
* [point](/reference/led/point)
|
||||
* [screenshot](/functions/screenshot)
|
||||
* [set display mode](/functions/set-display-mode)
|
||||
* [set brightness](/reference/led/set-brightness)
|
||||
* [stop animation](/reference/led/stop-animation)
|
||||
* [toggle](/reference/led/toggle)
|
||||
* [toggle all](/reference/led/toggle-all)
|
||||
* [unplot](/reference/led/unplot)
|
||||
|
||||
### Input
|
||||
|
||||
* [acceleration](/microbit/reference/input/acceleration)
|
||||
* [rotation](/microbit/functions/rotation)
|
||||
* [button is pressed](/microbit/reference/input/button-is-pressed)
|
||||
* [compass heading](/microbit/reference/input/compass-heading)
|
||||
* [temperature](/microbit/reference/input/temperature)
|
||||
* [running time](/microbit/reference/input/running-time)
|
||||
* [on shake](/microbit/reference/input/on-gesture)
|
||||
* [on button pressed](/microbit/reference/input/on-button-pressed)
|
||||
* [on logo down](/microbit/functions/on-logo-down)
|
||||
* [on logo up](/microbit/functions/on-logo-up)
|
||||
* [on pin pressed](/microbit/reference/input/on-pin-pressed)
|
||||
* [on screen down](/microbit/functions/on-screen-down)
|
||||
* [on screen up](/microbit/functions/on-screen-up)
|
||||
* [pin is pressed](/microbit/reference/input/pin-is-pressed)
|
||||
* [acceleration](/reference/input/acceleration)
|
||||
* [rotation](/functions/rotation)
|
||||
* [button is pressed](/reference/input/button-is-pressed)
|
||||
* [compass heading](/reference/input/compass-heading)
|
||||
* [temperature](/reference/input/temperature)
|
||||
* [running time](/reference/input/running-time)
|
||||
* [on shake](/reference/input/on-gesture)
|
||||
* [on button pressed](/reference/input/on-button-pressed)
|
||||
* [on logo down](/functions/on-logo-down)
|
||||
* [on logo up](/functions/on-logo-up)
|
||||
* [on pin pressed](/reference/input/on-pin-pressed)
|
||||
* [on screen down](/functions/on-screen-down)
|
||||
* [on screen up](/functions/on-screen-up)
|
||||
* [pin is pressed](/reference/input/pin-is-pressed)
|
||||
|
||||
### Image
|
||||
|
||||
* [create image](/microbit/reference/images/create-image)
|
||||
* [clear](/microbit/reference/basic/clear-screen)
|
||||
* [pixel](/microbit/reference/images/pixel)
|
||||
* [plot frame](/microbit/reference/led/plot-frame)
|
||||
* [plot image](/microbit/reference/led/plot-image)
|
||||
* [scroll image](/microbit/reference/images/scroll-image)
|
||||
* [show frame](/microbit/functions/show-frame)
|
||||
* [set pixel](/microbit/reference/images/set-pixel)
|
||||
* [show image](/microbit/reference/images/show-image)
|
||||
* [width](/microbit/functions/width)
|
||||
* [create image](/reference/images/create-image)
|
||||
* [clear](/reference/basic/clear-screen)
|
||||
* [pixel](/reference/images/pixel)
|
||||
* [plot frame](/reference/led/plot-frame)
|
||||
* [plot image](/reference/led/plot-image)
|
||||
* [scroll image](/reference/images/scroll-image)
|
||||
* [show frame](/functions/show-frame)
|
||||
* [set pixel](/reference/images/set-pixel)
|
||||
* [show image](/reference/images/show-image)
|
||||
* [width](/functions/width)
|
||||
|
||||
### Music
|
||||
|
||||
* [play note](/microbit/functions/play-note)
|
||||
* [note](/microbit/functions/note)
|
||||
* [ring](/microbit/reference/music/ring)
|
||||
* [play note](/functions/play-note)
|
||||
* [note](/functions/note)
|
||||
* [ring](/reference/music/ring)
|
||||
|
||||
### Pins
|
||||
|
||||
* [digital read pin](/microbit/reference/pins/digital-read-pin)
|
||||
* [digital write pin](/microbit/reference/pins/digital-write-pin)
|
||||
* [analog read pin](/microbit/reference/pins/analog-read-pin)
|
||||
* [analog write pin](/microbit/reference/pins/analog-write-pin)
|
||||
* [analog set period](/microbit/reference/pins/analog-set-period)
|
||||
* [analog pitch](/microbit/reference/pins/analog-pitch)
|
||||
* [analog set pitch pin](/microbit/reference/pins/analog-set-pitch-pin)
|
||||
* [servo write pin](/microbit/reference/pins/servo-write-pin)
|
||||
* [servo set pulse](/microbit/reference/pins/servo-set-pulse)
|
||||
* [map](/microbit/functions/map)
|
||||
* [digital read pin](/reference/pins/digital-read-pin)
|
||||
* [digital write pin](/reference/pins/digital-write-pin)
|
||||
* [analog read pin](/reference/pins/analog-read-pin)
|
||||
* [analog write pin](/reference/pins/analog-write-pin)
|
||||
* [analog set period](/reference/pins/analog-set-period)
|
||||
* [analog pitch](/reference/pins/analog-pitch)
|
||||
* [analog set pitch pin](/reference/pins/analog-set-pitch-pin)
|
||||
* [servo write pin](/reference/pins/servo-write-pin)
|
||||
* [servo set pulse](/reference/pins/servo-set-pulse)
|
||||
* [map](/functions/map)
|
||||
|
||||
### Control
|
||||
|
||||
* [in background](/microbit/reference/control/in-background)
|
||||
* [reset](/microbit/functions/reset)
|
||||
* [in background](/reference/control/in-background)
|
||||
* [reset](/functions/reset)
|
||||
|
||||
### Devices
|
||||
|
||||
Functions in this category require to be connected to a remote device.
|
||||
|
||||
* [tell camera to](/microbit/reference/devices/tell-camera-to)
|
||||
* [tell remote control to](/microbit/reference/devices/tell-remote-control-to)
|
||||
* [raise alert to](/microbit/reference/devices/raise-alert-to)
|
||||
* [on notified](/microbit/reference/devices/on-notified)
|
||||
* [tell camera to](/reference/devices/tell-camera-to)
|
||||
* [tell remote control to](/reference/devices/tell-remote-control-to)
|
||||
* [raise alert to](/reference/devices/raise-alert-to)
|
||||
* [on notified](/reference/devices/on-notified)
|
||||
|
||||
### Libraries
|
||||
|
||||
* [game library](/microbit/js/game-library)
|
||||
* [serial library](/microbit/js/serial-library)
|
||||
* [game library](/js/game-library)
|
||||
* [serial library](/js/serial-library)
|
||||
|
||||
### ~
|
||||
|
||||
@@ -194,23 +194,23 @@ Functions in this category require to be connected to a remote device.
|
||||
|
||||
## Run
|
||||
|
||||
* [scripts in the browser](/microbit/js/simulator)
|
||||
* [scripts on your BBC micro:bit](/microbit/device/usb)
|
||||
* [scripts in the browser](/js/simulator)
|
||||
* [scripts on your BBC micro:bit](/device/usb)
|
||||
|
||||
## Debugging
|
||||
|
||||
* use the [serial library](/microbit/js/serial-library) to print data from your micro:bit on your computer
|
||||
* learn about the [device error codes](/microbit/device/errors) that are displayed when sad faces occur
|
||||
* use the [serial library](/js/serial-library) to print data from your micro:bit on your computer
|
||||
* learn about the [device error codes](/device/errors) that are displayed when sad faces occur
|
||||
|
||||
## Edit/Publish
|
||||
|
||||
* [the Touch Develop Editor](/microbit/js/editor)
|
||||
* [publish a script](/microbit/js/publishing)
|
||||
* [the Touch Develop Editor](/js/editor)
|
||||
* [publish a script](/js/publishing)
|
||||
|
||||
## Creating Tutorials
|
||||
|
||||
* [create a tutorial](/microbit/js/create-tutorials)
|
||||
* [markdown syntax](/microbit/js/markdown)
|
||||
* [create a tutorial](/js/create-tutorials)
|
||||
* [markdown syntax](/js/markdown)
|
||||
|
||||
### ~
|
||||
|
||||
|
@@ -8,7 +8,7 @@ A variable is a place where you can store data so that you can use it later in y
|
||||
|
||||
### Block Editor
|
||||
|
||||
In the Block Editor, all variables are global. See [Block Editor](/microbit/blocks/editor) for info on creating global variables in a Block Editor script. The following block is used to set (assign) global variable's value:
|
||||
In the Block Editor, all variables are global. See [Block Editor](/blocks/editor) for info on creating global variables in a Block Editor script. The following block is used to set (assign) global variable's value:
|
||||
|
||||

|
||||
|
||||
@@ -18,23 +18,23 @@ The block below retrieves (gets) the current value of a global variable:
|
||||
|
||||
### Touch Develop
|
||||
|
||||
In Touch Develop variables are either [global](/microbit/js/data) or [local](/microbit/reference/variables/var). Variables have a name, a [type](/microbit/js/types), and value:
|
||||
In Touch Develop variables are either [global](/js/data) or [local](/reference/variables/var). Variables have a name, a [type](/js/types), and value:
|
||||
|
||||
* the *name* is how you'll refer to the variable
|
||||
* the *type* refers to the kind of value a variable can store
|
||||
* the *value* refers to what's stored in the variable
|
||||
|
||||
[Global variables](/microbit/js/data) are variables that are available throughout your script. Unlike [local variables](/microbit/reference/variables/var), global variables are accessible across functions and in nested code blocks.
|
||||
[Global variables](/js/data) are variables that are available throughout your script. Unlike [local variables](/reference/variables/var), global variables are accessible across functions and in nested code blocks.
|
||||
|
||||
### Create a global variable
|
||||
|
||||
To create a new global variable:
|
||||
|
||||
1. In the Touch Develop [editor](/microbit/js/editor), click `script` (to the right of the search box).
|
||||
1. In the Touch Develop [editor](/js/editor), click `script` (to the right of the search box).
|
||||
|
||||
2. Click `+` **add new**.
|
||||
|
||||
3. Click `data->` **data** and then choose a [type](/microbit/js/types).
|
||||
3. Click `data->` **data** and then choose a [type](/js/types).
|
||||
|
||||
4. Enter a name for your global variable and click **OK**.
|
||||
|
||||
@@ -42,7 +42,7 @@ To create a new global variable:
|
||||
|
||||
To use a global variable that you've declared (using steps above):
|
||||
|
||||
1. In the Touch Develop [editor](/microbit/js/editor), click `data-> ` **data** or `data->` + *variable name*.
|
||||
1. In the Touch Develop [editor](/js/editor), click `data-> ` **data** or `data->` + *variable name*.
|
||||
|
||||
2. Click `:=` (assignment).
|
||||
|
||||
@@ -68,7 +68,7 @@ name2 = "Mike"
|
||||
bool = true
|
||||
```
|
||||
|
||||
(for info on creating image variables, see [Image](/microbit/reference/image/image))
|
||||
(for info on creating image variables, see [Image](/reference/image/image))
|
||||
|
||||
Once you've defined a variable and set it's initial value, use the variable's name whenever you need what's stored in the variable. For example, the following code gets the value stored in the global `counter` variable and shows it on the screen:
|
||||
|
||||
@@ -76,7 +76,7 @@ Once you've defined a variable and set it's initial value, use the variable's na
|
||||
basic.showNumber(counter, 100)
|
||||
```
|
||||
|
||||
To change the contents of a variable use the [assignment operator](/microbit/reference/variables/assign) `:=`. The following code increments `counter` by 10:
|
||||
To change the contents of a variable use the [assignment operator](/reference/variables/assign) `:=`. The following code increments `counter` by 10:
|
||||
|
||||
```
|
||||
counter = counter + 10
|
||||
@@ -86,7 +86,7 @@ counter = counter + 10
|
||||
|
||||
To **promote** a local variable to a global variable:
|
||||
|
||||
* select the local variable name and click `promote to data`. The [var](/microbit/reference/variables/var) keyword changes to the data symbol `data->`.
|
||||
* select the local variable name and click `promote to data`. The [var](/reference/variables/var) keyword changes to the data symbol `data->`.
|
||||
|
||||
To **demote** a global variable to a local variable:
|
||||
|
||||
@@ -104,9 +104,9 @@ To see a list of the global variables in your script:
|
||||
|
||||
### Lessons
|
||||
|
||||
[counter](/microbit/lessons/counter), [rotation animation](/microbit/lessons/rotation-animation), [digital pet](/microbit/lessons/digital-pet), [offset image](/microbit/lessons/offset-image)
|
||||
[counter](/lessons/counter), [rotation animation](/lessons/rotation-animation), [digital pet](/lessons/digital-pet), [offset image](/lessons/offset-image)
|
||||
|
||||
### See also
|
||||
|
||||
[local variables](/microbit/reference/variables/var), [types](/microbit/js/types), [assignment operator](/microbit/reference/variables/assign)
|
||||
[local variables](/reference/variables/var), [types](/js/types), [assignment operator](/reference/variables/assign)
|
||||
|
||||
|
@@ -5,7 +5,7 @@ The Touch Develop editor.
|
||||
### @parent js/contents
|
||||
|
||||
|
||||
The Touch Develop editor is where you write and test your code. If you're new to Touch Develop, check out the [Touch Develop editor video](/microbit/getting-started/touchdevelop-editor).
|
||||
The Touch Develop editor is where you write and test your code. If you're new to Touch Develop, check out the [Touch Develop editor video](/getting-started/touchdevelop-editor).
|
||||
|
||||
To create a new Touch Develop script:
|
||||
|
||||
@@ -15,7 +15,7 @@ To create a new Touch Develop script:
|
||||
|
||||
3. Type a name for your script and click **create**.
|
||||
|
||||
An empty script with a [function](/microbit/js/function) called `main` is created.
|
||||
An empty script with a [function](/js/function) called `main` is created.
|
||||
|
||||
## The Editor Menu Bar
|
||||
|
||||
@@ -24,8 +24,8 @@ The Touch Develop editor has a bar of options above the code area:
|
||||

|
||||
|
||||
* `my scripts` takes you back to a list of your scripts (My Scripts). The open script is automatically saved (in the cloud) when you leave the editor.
|
||||
* `run` executes your script, showing you the results on the on-screen micro:bit device. See [run scripts in the browser](/microbit/js/simulator) for more about this.
|
||||
* `compile` sends your script to an ARM compiler, which creates a file that you can run on your micro:bit. See [run scripts on your micro:bit](/microbit/device/usb) for more info.
|
||||
* `run` executes your script, showing you the results on the on-screen micro:bit device. See [run scripts in the browser](/js/simulator) for more about this.
|
||||
* `compile` sends your script to an ARM compiler, which creates a file that you can run on your micro:bit. See [run scripts on your micro:bit](/device/usb) for more info.
|
||||
* `undo` undoes changes that you made to your script.
|
||||
* `search code...` search for functions in libraries such as the micro:bit library.
|
||||
* `script` opens script options, where you can do things like publish and preview. See **script options** below.
|
||||
@@ -34,7 +34,7 @@ Many of the above buttons aren't much use until you've written some code, so let
|
||||
|
||||
## Code Keyboard
|
||||
|
||||
The Code Keyboard makes it easy to write code on a touch screen device or by using your mouse. You can also type code using your computer keyboard if you know what function or statement you want (see [Touch Develop documentation](/microbit/js/contents) for a complete list).
|
||||
The Code Keyboard makes it easy to write code on a touch screen device or by using your mouse. You can also type code using your computer keyboard if you know what function or statement you want (see [Touch Develop documentation](/js/contents) for a complete list).
|
||||
|
||||
To open the Code Keyboard, click on a line of code:
|
||||
|
||||
@@ -44,13 +44,13 @@ An on-screen keyboard appears, with buttons that vary depending on what's select
|
||||
|
||||
### Statements
|
||||
|
||||
The first row of the Code Keyboard has Touch Develop [statements](/microbit/js/statements) that you can insert into your code. These buttons are blue and include things like [var](/microbit/reference/variables/var), [if](/microbit/reference/logic/if), [for](/microbit/reference/loops/for) , and [while](/microbit/js/while). Click `more` to see additional statements.
|
||||
The first row of the Code Keyboard has Touch Develop [statements](/js/statements) that you can insert into your code. These buttons are blue and include things like [var](/reference/variables/var), [if](/reference/logic/if), [for](/reference/loops/for) , and [while](/js/while). Click `more` to see additional statements.
|
||||
|
||||
### The BBC micro:bit, math, and code buttons
|
||||
|
||||
* `micro:bit`: click to see all the [micro:bit functions](/microbit/js/contents); click `more` to scroll left to right. The micro:bit functions are also grouped together behind the following category buttons: `basic`, `control`, `input`, `image`, `led`, and`pins`
|
||||
* `code`: click to access functions you've written (see [call a function](/microbit/js/call) for more info)
|
||||
* `math`: click to see [math functions](/microbit/js/math); such as `abs` and `round`
|
||||
* `micro:bit`: click to see all the [micro:bit functions](/js/contents); click `more` to scroll left to right. The micro:bit functions are also grouped together behind the following category buttons: `basic`, `control`, `input`, `image`, `led`, and`pins`
|
||||
* `code`: click to access functions you've written (see [call a function](/js/call) for more info)
|
||||
* `math`: click to see [math functions](/js/math); such as `abs` and `round`
|
||||
* `bits`: click to see functions for bit-level manipulation of integers
|
||||
|
||||
### Editing code: add, copy, paste, and cut
|
||||
@@ -68,7 +68,7 @@ To copy, cut, or comment out a block of code (more than one line):
|
||||
|
||||
2. Press and hold the `Shift` key, and then press the `Up arrow` or `Down arrow` key on your keyboard (this selects multiple lines).
|
||||
|
||||
3. Choose a block editing option like copy, cut, or [comment out](/microbit/js/comment).
|
||||
3. Choose a block editing option like copy, cut, or [comment out](/js/comment).
|
||||
|
||||
### Script options
|
||||
|
||||
@@ -79,12 +79,12 @@ Click `script` (in the upper-right corner) to open the script options:
|
||||
Here you'll find options like...
|
||||
|
||||
* `script properties`: the script name, description, and whether or not the script is a library (more info below)
|
||||
* `publish`: share a script with other users by [publishing](/microbit/js/publishing) it
|
||||
* `share`: share a link to a published script (see [publish as script](/microbit/js/publishing) for more info)
|
||||
* `publish`: share a script with other users by [publishing](/js/publishing) it
|
||||
* `share`: share a link to a published script (see [publish as script](/js/publishing) for more info)
|
||||
* `preview`: preview a documentation script
|
||||
* `+` `add new`: add a new [function](/microbit/js/function), [global variable](/microbit/js/data), picture, or library to a script
|
||||
* `+` `add new`: add a new [function](/js/function), [global variable](/js/data), picture, or library to a script
|
||||
* *code*: the functions in your script; click a function to open it in the editor
|
||||
* *global vars*: the [global variables](/microbit/js/data) in your script; click a variable to go to that variable
|
||||
* *global vars*: the [global variables](/js/data) in your script; click a variable to go to that variable
|
||||
* *libraries*: the libraries added to your script
|
||||
* *art*: picture and video resources added to your script
|
||||
|
||||
@@ -100,13 +100,13 @@ To edit a script's properties, click `script` (in the upper-right corner), and t
|
||||
|
||||
### Comments
|
||||
|
||||
Comments are notes within your scripts. To learn how to insert comments into your scripts, see [Comments](/microbit/js/comment). You can format your comments using [markdown syntax](/microbit/js/markdown).
|
||||
Comments are notes within your scripts. To learn how to insert comments into your scripts, see [Comments](/js/comment). You can format your comments using [markdown syntax](/js/markdown).
|
||||
|
||||
### Share your scripts
|
||||
|
||||
Share your scripts with other people by publishing them. See [publish a script](/microbit/js/publishing) for more info.
|
||||
Share your scripts with other people by publishing them. See [publish a script](/js/publishing) for more info.
|
||||
|
||||
### See also
|
||||
|
||||
[publish a script](/microbit/js/publishing), [Touch Develop documentation](/microbit/js/contents)
|
||||
[publish a script](/js/publishing), [Touch Develop documentation](/js/contents)
|
||||
|
||||
|
@@ -51,9 +51,9 @@ input.onButtonPressed(Button.A, () => {
|
||||
|
||||
### To learn more
|
||||
|
||||
To learn more about how the BBC micro:bit queues up and schedules event handlers, see [the BBC micro:bit - a reactive system](/microbit/device/reactive)
|
||||
To learn more about how the BBC micro:bit queues up and schedules event handlers, see [the BBC micro:bit - a reactive system](/device/reactive)
|
||||
|
||||
### see also
|
||||
|
||||
[on button pressed](/microbit/reference/input/on-button-pressed), [on logo up](/microbit/functions/on-logo-up), [on logo down](/microbit/functions/on-logo-down), [on screen up](/microbit/functions/on-screen-up), [on screen down](/microbit/functions/on-screen-down), [on shake](/microbit/reference/input/on-gesture), [on pin pressed](/microbit/reference/input/on-pin-pressed)
|
||||
[on button pressed](/reference/input/on-button-pressed), [on logo up](/functions/on-logo-up), [on logo down](/functions/on-logo-down), [on screen up](/functions/on-screen-up), [on screen down](/functions/on-screen-down), [on shake](/reference/input/on-gesture), [on pin pressed](/reference/input/on-pin-pressed)
|
||||
|
||||
|
@@ -55,7 +55,7 @@ for (let i = 0; i < 5; i++) {
|
||||
|
||||
### Example: draw a box
|
||||
|
||||
The [LED screen](/microbit/device/screen) has a fixed number of rows and columns (5x5), which is ideal for a for loop. This example uses a for loop to turn on the LEDs along the edge of the screen, making a square.
|
||||
The [LED screen](/device/screen) has a fixed number of rows and columns (5x5), which is ideal for a for loop. This example uses a for loop to turn on the LEDs along the edge of the screen, making a square.
|
||||
|
||||
```
|
||||
for (let i1 = 0; i1 < 5; i1++) {
|
||||
@@ -69,15 +69,15 @@ for (let i1 = 0; i1 < 5; i1++) {
|
||||
|
||||
### ~hint
|
||||
|
||||
Want to exit a loop early? The [break](/microbit/js/break) statement exits a loop before the end value is reached.
|
||||
Want to exit a loop early? The [break](/js/break) statement exits a loop before the end value is reached.
|
||||
|
||||
### ~
|
||||
|
||||
### Lessons
|
||||
|
||||
[looper](/microbit/lessons/looper), [strobe light](/microbit/lessons/strobe-light)
|
||||
[looper](/lessons/looper), [strobe light](/lessons/strobe-light)
|
||||
|
||||
### See also
|
||||
|
||||
[while](/microbit/js/while), [break](/microbit/js/break), [if](/microbit/reference/logic/if)
|
||||
[while](/js/while), [break](/js/break), [if](/reference/logic/if)
|
||||
|
||||
|
@@ -7,7 +7,7 @@ How to define a function with input and output parameters.
|
||||
|
||||
A function is a unit of code that performs a specific task and returns a result.
|
||||
|
||||
Functions are ideal when you need to perform an action multiple times. Instead of repeating a block of code in your script, you can put the code in a function and simply [call the function](/microbit/js/call) when needed.
|
||||
Functions are ideal when you need to perform an action multiple times. Instead of repeating a block of code in your script, you can put the code in a function and simply [call the function](/js/call) when needed.
|
||||
|
||||
*Why use functions?* Functions makes your code easier to read, debug, and update.
|
||||
|
||||
@@ -40,10 +40,10 @@ Click the function name to edit the function properties (i.e. change the name or
|
||||
|
||||
Functions have three parts:
|
||||
|
||||
* [input and output parameters](/microbit/js/functionparameters)
|
||||
* [input and output parameters](/js/functionparameters)
|
||||
* the function *body* (the code that performs a task)
|
||||
|
||||
- one or more [return](/microbit/js/return) statements (the output of the function)
|
||||
- one or more [return](/js/return) statements (the output of the function)
|
||||
|
||||
#### Example function
|
||||
|
||||
@@ -61,8 +61,8 @@ export function square(x: number) : number {
|
||||
|
||||
In the above code...
|
||||
|
||||
* ``x `` is the [input parameter](/microbit/js/functionparameters) ([Number](/microbit/reference/types/number) type)
|
||||
* ``result`` is the [output parameter](/microbit/js/functionparameters) ([Number](/microbit/reference/types/number) type)
|
||||
* ``x `` is the [input parameter](/js/functionparameters) ([Number](/reference/types/number) type)
|
||||
* ``result`` is the [output parameter](/js/functionparameters) ([Number](/reference/types/number) type)
|
||||
* `return x * x` is the function body (which returns the value of the expression `x * x`)
|
||||
|
||||
### Add function parameters
|
||||
@@ -75,7 +75,7 @@ In the above code...
|
||||
|
||||
4. Click **add input parameter** or **add output parameter**. The parameter is added to your function.
|
||||
|
||||
Click the parameter name to rename it and click the [type](/microbit/js/types) to change the variable type. For more info, see [function parameters](/microbit/js/functionparameters).
|
||||
Click the parameter name to rename it and click the [type](/js/types) to change the variable type. For more info, see [function parameters](/js/functionparameters).
|
||||
|
||||
### ~hide
|
||||
|
||||
@@ -93,7 +93,7 @@ If you've already written some code that you'd like to have in a function, you c
|
||||
|
||||
### Function documentation
|
||||
|
||||
Use a [comment](/microbit/js/comment) at the beginning of your functions to describe the function. When you insert a function into your code, the comment text appears in the help area of the Code Keyboard.
|
||||
Use a [comment](/js/comment) at the beginning of your functions to describe the function. When you insert a function into your code, the comment text appears in the help area of the Code Keyboard.
|
||||
|
||||
### See all your functions
|
||||
|
||||
@@ -109,9 +109,9 @@ If you don't want people to see the code in your function, you can make the func
|
||||
|
||||
### Lessons
|
||||
|
||||
[digital pet](/microbit/lessons/digital-pet)
|
||||
[digital pet](/lessons/digital-pet)
|
||||
|
||||
### See also
|
||||
|
||||
[function parameters](/microbit/js/functionparameters), [call a function](/microbit/js/call), [return from a function](/microbit/js/return)
|
||||
[function parameters](/js/functionparameters), [call a function](/js/call), [return from a function](/js/return)
|
||||
|
||||
|
@@ -5,9 +5,9 @@ How to use parameters to pass info in and out of an function.
|
||||
### @parent js/function
|
||||
|
||||
|
||||
A [function](/microbit/js/function) can have multiple input parameters and/or a single output parameter. The parameters must be one of the supported variable [types](/microbit/js/types).
|
||||
A [function](/js/function) can have multiple input parameters and/or a single output parameter. The parameters must be one of the supported variable [types](/js/types).
|
||||
|
||||
When you first [create a function](/microbit/js/function), it looks like this:
|
||||
When you first [create a function](/js/function), it looks like this:
|
||||
```
|
||||
export function doStuff() {
|
||||
}
|
||||
@@ -25,18 +25,18 @@ export function doStuff() {
|
||||
|
||||
#### Input parameters
|
||||
|
||||
The default type for an input parameter is [Number](/microbit/reference/types/number):
|
||||
The default type for an input parameter is [Number](/reference/types/number):
|
||||
|
||||
```
|
||||
export function oneInput(p: number) {
|
||||
}
|
||||
```
|
||||
|
||||
To change the default type, click the type ([Number](/microbit/reference/types/number) in this case) and change it to [String](/microbit/reference/types/string), [Boolean](/microbit/reference/types/boolean), or [Image](/microbit/reference/image/image). You can add multiple input parameters to a function.
|
||||
To change the default type, click the type ([Number](/reference/types/number) in this case) and change it to [String](/reference/types/string), [Boolean](/reference/types/boolean), or [Image](/reference/image/image). You can add multiple input parameters to a function.
|
||||
|
||||
#### Output parameter
|
||||
|
||||
the default type for an output parameter is [Number](/microbit/reference/types/number):
|
||||
the default type for an output parameter is [Number](/reference/types/number):
|
||||
|
||||
```
|
||||
export function output() : number {
|
||||
@@ -46,7 +46,7 @@ export function output() : number {
|
||||
}
|
||||
```
|
||||
|
||||
To change the default type, click the type ([Number](/microbit/reference/types/number) in this case) and change it to [String](/microbit/reference/types/string), [Boolean](/microbit/reference/types/boolean), or [Image](/microbit/reference/image/image).
|
||||
To change the default type, click the type ([Number](/reference/types/number) in this case) and change it to [String](/reference/types/string), [Boolean](/reference/types/boolean), or [Image](/reference/image/image).
|
||||
|
||||
### Inputs and output function
|
||||
|
||||
@@ -62,5 +62,5 @@ export function inputsAndOutput(p: number, q: number) : number {
|
||||
|
||||
### See also
|
||||
|
||||
[call a function](/microbit/js/call), [create a function](/microbit/js/function), [return](/microbit/js/return)
|
||||
[call a function](/js/call), [create a function](/js/function), [return](/js/return)
|
||||
|
||||
|
@@ -9,34 +9,34 @@ Overview of Touch Develop lessons for the BBC micro:bit.
|
||||
|
||||
## Maker
|
||||
|
||||
* [Telegraph](/microbit/pzeagwoudd), play the telegraph game between 2 BBC micro:bits
|
||||
* [Ornament Chain](/microbit/rnvpgo), play the ornament chain game between 2 BBC micro:bits
|
||||
* [Telegraph](/pzeagwoudd), play the telegraph game between 2 BBC micro:bits
|
||||
* [Ornament Chain](/rnvpgo), play the ornament chain game between 2 BBC micro:bits
|
||||
|
||||
### ~hide
|
||||
|
||||
* [The Watch](/microbit/lessons/the-watch), design and create The Watch
|
||||
* [Hack your headphones](/microbit/lessons/hack-your-headphones), create music on the BBC micro:bit by hacking your headphones
|
||||
* [Banana Keyboard](/microbit/lessons/banana-keyboard), create music with fruits
|
||||
* [The Watch](/lessons/the-watch), design and create The Watch
|
||||
* [Hack your headphones](/lessons/hack-your-headphones), create music on the BBC micro:bit by hacking your headphones
|
||||
* [Banana Keyboard](/lessons/banana-keyboard), create music with fruits
|
||||
|
||||
### ~
|
||||
|
||||
## Beginner
|
||||
|
||||
* [Night light](/microbit/vltwrzuqto), dim the LEDs with set brightness
|
||||
* [Beautiful image](/microbit/nudwzmphyx), show a beautiful image with show LEDs
|
||||
* [Smiley,](/microbit/zsohipimef) smiley and frowney with show animation
|
||||
* [Lucky 7](/microbit/rqhxxqppqu), show a number on the LED screen with show number
|
||||
* [Answering machine](/microbit/bnkmeqymuh), show a text message with show string
|
||||
* [Snowflake fall](/microbit/zhcfmiejlg), repeat an animation with forever
|
||||
* [Screen wipe](/microbit/hlnitnqjjk), turn off the LEDs with clear screen
|
||||
* [Flashing heart](/microbit/bwmxfwqswx), display images with a pause
|
||||
* [Blink](/microbit/jbbutifslm), turn an LED on and off with plot
|
||||
* [Night light](/vltwrzuqto), dim the LEDs with set brightness
|
||||
* [Beautiful image](/nudwzmphyx), show a beautiful image with show LEDs
|
||||
* [Smiley,](/zsohipimef) smiley and frowney with show animation
|
||||
* [Lucky 7](/rqhxxqppqu), show a number on the LED screen with show number
|
||||
* [Answering machine](/bnkmeqymuh), show a text message with show string
|
||||
* [Snowflake fall](/zhcfmiejlg), repeat an animation with forever
|
||||
* [Screen wipe](/hlnitnqjjk), turn off the LEDs with clear screen
|
||||
* [Flashing heart](/bwmxfwqswx), display images with a pause
|
||||
* [Blink](/jbbutifslm), turn an LED on and off with plot
|
||||
|
||||
### ~hide
|
||||
|
||||
* [Bounce image](/microbit/lessons/bounce-image), scroll an image across the screen on shake
|
||||
* [Magic logo](/microbit/lessons/magic-logo), show an image on logo up
|
||||
* [Glowing sword](/microbit/lessons/glowing-sword), make a glowing sword with fade in and fade out
|
||||
* [Bounce image](/lessons/bounce-image), scroll an image across the screen on shake
|
||||
* [Magic logo](/lessons/magic-logo), show an image on logo up
|
||||
* [Glowing sword](/lessons/glowing-sword), make a glowing sword with fade in and fade out
|
||||
|
||||
### ~
|
||||
|
||||
@@ -44,24 +44,24 @@ Overview of Touch Develop lessons for the BBC micro:bit.
|
||||
|
||||
## Intermediate
|
||||
|
||||
* [Zoomer](/microbit/fwrohhjqql), measure the force with acceleration
|
||||
* [Strobe light](/microbit/jguqlzeayr), develop shapes with a nested for loops
|
||||
* [Digi yoyo](/microbit/lppocrbpys), create a counter with a while loop
|
||||
* [Die roll](/microbit/lzblatmknq), spin with more if statements
|
||||
* [Spinner](/microbit/dzijduruek), spin the arrow with multiple if statements
|
||||
* [Truth or dare](/microbit/filuzbwauo), a game that forces each player to reveal a secret or do something funny with if statement
|
||||
* [Love meter](/microbit/rrmlrvojfa), create a love meter with on pin pressed
|
||||
* [Guess the number](/microbit/ftsenbvqwz), guess a random number with random
|
||||
* [Magic 8](/microbit/fyjinpjuqu), a fortune teller game with the BBC micro:bit
|
||||
* [Counter](/microbit/rerlmjgjut), display a number with a variable
|
||||
* [Glowing pendulum](/microbit/xrnsveuwxj), construct a pendulum that glows using acceleration
|
||||
* [Looper](/microbit/nxcddtbizi), display a series of numbers with a for loop index
|
||||
* [Zoomer](/fwrohhjqql), measure the force with acceleration
|
||||
* [Strobe light](/jguqlzeayr), develop shapes with a nested for loops
|
||||
* [Digi yoyo](/lppocrbpys), create a counter with a while loop
|
||||
* [Die roll](/lzblatmknq), spin with more if statements
|
||||
* [Spinner](/dzijduruek), spin the arrow with multiple if statements
|
||||
* [Truth or dare](/filuzbwauo), a game that forces each player to reveal a secret or do something funny with if statement
|
||||
* [Love meter](/rrmlrvojfa), create a love meter with on pin pressed
|
||||
* [Guess the number](/ftsenbvqwz), guess a random number with random
|
||||
* [Magic 8](/fyjinpjuqu), a fortune teller game with the BBC micro:bit
|
||||
* [Counter](/rerlmjgjut), display a number with a variable
|
||||
* [Glowing pendulum](/xrnsveuwxj), construct a pendulum that glows using acceleration
|
||||
* [Looper](/nxcddtbizi), display a series of numbers with a for loop index
|
||||
|
||||
### ~hide
|
||||
|
||||
* [Rotation animation](/microbit/lessons/rotation-animation), control an animation with a boolean variable
|
||||
* [Offset image](/microbit/lessons/offset-image), shift an image horizontally with image offset
|
||||
* [Compass](/microbit/lessons/compass), displays the direction the BBC micro:bit is pointing
|
||||
* [Rotation animation](/lessons/rotation-animation), control an animation with a boolean variable
|
||||
* [Offset image](/lessons/offset-image), shift an image horizontally with image offset
|
||||
* [Compass](/lessons/compass), displays the direction the BBC micro:bit is pointing
|
||||
|
||||
### ~
|
||||
|
||||
@@ -69,38 +69,38 @@ Overview of Touch Develop lessons for the BBC micro:bit.
|
||||
|
||||
## Advanced
|
||||
|
||||
* [Rock paper scissors](/microbit/tnmtbvyyma), use image offsets with local variables
|
||||
* [Digital pet](/microbit/vefocoajpb), a display of pet images with sub-functions
|
||||
* [Catch the egg](/microbit/reczlreqob), catch falling eggs in a basket with an acceleration controller
|
||||
* [Headbands](/microbit/bzrusu), create a charades game with a collection of strings that hold the words
|
||||
* [Prank WiFi](/microbit/dceikq), create fake WiFi to trick your friends
|
||||
* [Flipping bird](/microbit/lbhvywjzkv), use modulo with a conditional
|
||||
* [Runaway pac man](/microbit/loafab), construct the game pac man with the BBC micro:bit
|
||||
* [Line of Fire](/microbit/fzcoly), make a game to test hand-eye coordination
|
||||
* [The hat game](/microbit/njynsd), make a game to test your focus on the moving ball
|
||||
* [Pong](/microbit/xcenyy), a light bouncing from left to right
|
||||
* [Meteorite](/microbit/zaidka), a game where meteorites are coming for you one by one
|
||||
* [Minesweeper](/microbit/jaeeve), make a game to test your memory for placing a LED mine then finding the hidden LED mine
|
||||
* [Bop it](/microbit/zlpndm), a game where you have to keep up with the commands
|
||||
* [Letter Up](/microbit/ftlqjo), a guessing game with string operators with string at
|
||||
* [Racing Buttons](/microbit/hcuxid), racing game to determine if player 1 presses Button A faster or if player 2 presses Button B faster
|
||||
* [Rock paper scissors](/tnmtbvyyma), use image offsets with local variables
|
||||
* [Digital pet](/vefocoajpb), a display of pet images with sub-functions
|
||||
* [Catch the egg](/reczlreqob), catch falling eggs in a basket with an acceleration controller
|
||||
* [Headbands](/bzrusu), create a charades game with a collection of strings that hold the words
|
||||
* [Prank WiFi](/dceikq), create fake WiFi to trick your friends
|
||||
* [Flipping bird](/lbhvywjzkv), use modulo with a conditional
|
||||
* [Runaway pac man](/loafab), construct the game pac man with the BBC micro:bit
|
||||
* [Line of Fire](/fzcoly), make a game to test hand-eye coordination
|
||||
* [The hat game](/njynsd), make a game to test your focus on the moving ball
|
||||
* [Pong](/xcenyy), a light bouncing from left to right
|
||||
* [Meteorite](/zaidka), a game where meteorites are coming for you one by one
|
||||
* [Minesweeper](/jaeeve), make a game to test your memory for placing a LED mine then finding the hidden LED mine
|
||||
* [Bop it](/zlpndm), a game where you have to keep up with the commands
|
||||
* [Letter Up](/ftlqjo), a guessing game with string operators with string at
|
||||
* [Racing Buttons](/hcuxid), racing game to determine if player 1 presses Button A faster or if player 2 presses Button B faster
|
||||
|
||||
### ~hide
|
||||
|
||||
* [Transformers](/microbit/lessons/transformers), use functions to return values
|
||||
* [Speed button](/microbit/lessons/speed-button), code a speed game with running time
|
||||
* [Jailbreak](/microbit/lessons/jailbreak), break out of a counting loop by pressing button "A"
|
||||
* [2 player pong](/microbit/bzycll), collaborate with a classmate to develop Pong on multiple BBC micro:bits
|
||||
* [Transformers](/lessons/transformers), use functions to return values
|
||||
* [Speed button](/lessons/speed-button), code a speed game with running time
|
||||
* [Jailbreak](/lessons/jailbreak), break out of a counting loop by pressing button "A"
|
||||
* [2 player pong](/bzycll), collaborate with a classmate to develop Pong on multiple BBC micro:bits
|
||||
|
||||
### ~
|
||||
|
||||
### ~hide
|
||||
|
||||
* [Number psych](/microbit/lessons/number-psych), collaborate with multiple classmates to develop a game on multiple BBC micro:bits and a breadboard
|
||||
* [Number psych](/lessons/number-psych), collaborate with multiple classmates to develop a game on multiple BBC micro:bits and a breadboard
|
||||
|
||||
### ~
|
||||
|
||||
### @section full
|
||||
|
||||
The lessons promote computational thinking and computer science literacy[ read more...](/microbit/lessons/teach)
|
||||
The lessons promote computational thinking and computer science literacy[ read more...](/lessons/teach)
|
||||
|
||||
|
@@ -15,7 +15,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
game.startCountdown(10000)
|
||||
```
|
||||
|
||||
### [Countdown](/microbit/js/game-library/start-countdown)
|
||||
### [Countdown](/js/game-library/start-countdown)
|
||||
|
||||
If your game has a time limit, you can start a countdown in which case `game->current time` returns the remaining time.
|
||||
|
||||
@@ -25,7 +25,7 @@ If your game has a time limit, you can start a countdown in which case `game->cu
|
||||
export function startCountdown(ms: number)
|
||||
```
|
||||
|
||||
### [Game over](/microbit/js/game-library/game-over)
|
||||
### [Game over](/js/game-library/game-over)
|
||||
|
||||
If the `life` reaches zero or the time expires (see countdown), the game enters the **game over** mode. When the game is over, `game->is running` returns false
|
||||
|
||||
@@ -51,7 +51,7 @@ export function gameOver()
|
||||
|
||||
When a player achieves a goal, you can increase the game score
|
||||
|
||||
[Add Point to Score](/microbit/js/game-library/add-point-to-score)
|
||||
[Add Point to Score](/js/game-library/add-point-to-score)
|
||||
|
||||
* add score points to the current score
|
||||
|
||||
@@ -59,7 +59,7 @@ When a player achieves a goal, you can increase the game score
|
||||
export function addScore(points: number)
|
||||
```
|
||||
|
||||
[Score](/microbit/js/game-library/score)
|
||||
[Score](/js/game-library/score)
|
||||
|
||||
* set the current score to a particular value.
|
||||
|
||||
@@ -151,5 +151,5 @@ export function setBlink(sprite: micro_bitSprites.LedSprite, ms: number)
|
||||
|
||||
### Lessons
|
||||
|
||||
[bop it](/microbit/lessons/bop-it) | [game of chance](/microbit/lessons/game-of-chance) | [game counter](/microbit/lessons/game-counter)
|
||||
[bop it](/lessons/bop-it) | [game of chance](/lessons/game-of-chance) | [game counter](/lessons/game-counter)
|
||||
|
||||
|
@@ -39,5 +39,5 @@ export function score() : number
|
||||
|
||||
### Lessons
|
||||
|
||||
[bop it](/microbit/lessons/bop-it) | [game of chance](/microbit/lessons/game-of-chance) | [game counter](/microbit/lessons/game-counter)
|
||||
[bop it](/lessons/bop-it) | [game of chance](/lessons/game-of-chance) | [game counter](/lessons/game-counter)
|
||||
|
||||
|
@@ -39,5 +39,5 @@ export function score() : number
|
||||
|
||||
### Lessons
|
||||
|
||||
[bop it](/microbit/lessons/bop-it) | [game of chance](/microbit/lessons/game-of-chance) | [game counter](/microbit/lessons/game-counter)
|
||||
[bop it](/lessons/bop-it) | [game of chance](/lessons/game-of-chance) | [game counter](/lessons/game-counter)
|
||||
|
||||
|
@@ -20,5 +20,5 @@ game.gameOver()
|
||||
|
||||
### Lessons
|
||||
|
||||
[game of chance](/microbit/lessons/game-of-chance)
|
||||
[game of chance](/lessons/game-of-chance)
|
||||
|
||||
|
@@ -55,5 +55,5 @@ export function startCountdown(ms: number)
|
||||
|
||||
### Lessons
|
||||
|
||||
[bop it](/microbit/lessons/bop-it) | [game of chance](/microbit/lessons/game-of-chance) | [game counter](/microbit/lessons/game-counter)
|
||||
[bop it](/lessons/bop-it) | [game of chance](/lessons/game-of-chance) | [game counter](/lessons/game-counter)
|
||||
|
||||
|
@@ -53,5 +53,5 @@ export function startCountdown(ms: number)
|
||||
|
||||
### Lessons
|
||||
|
||||
[bop it](/microbit/lessons/bop-it) | [game of chance](/microbit/lessons/game-of-chance) | [game counter](/microbit/lessons/game-counter)
|
||||
[bop it](/lessons/bop-it) | [game of chance](/lessons/game-of-chance) | [game counter](/lessons/game-counter)
|
||||
|
||||
|
@@ -8,49 +8,49 @@ Overview of Games for the BBC micro:bit.
|
||||
|
||||
## Beginner Games
|
||||
|
||||
* [The Watch](/microbit/lessons/the-watch/activity), design and create The Watch
|
||||
* [Banana Keyboard](/microbit/lessons/banana-keyboard), create music with fruits
|
||||
* [The Watch](/lessons/the-watch/activity), design and create The Watch
|
||||
* [Banana Keyboard](/lessons/banana-keyboard), create music with fruits
|
||||
|
||||
### ~hide
|
||||
|
||||
* [Smiley,](/microbit/lessons/smiley) smiley and frowney with show animation
|
||||
* [Lucky 7](/microbit/lessons/lucky-7), show a number on the LED screen with show number
|
||||
* [Snowflake fall](/microbit/lessons/snowflake-fall), repeat an animation with forever
|
||||
* [Answering machine](/microbit/lessons/answering-machine), show a text message with show string
|
||||
* [Bounce image](/microbit/lessons/bounce-image), scroll an image across the screen on shake
|
||||
* [Magic logo](/microbit/lessons/magic-logo), show an image on logo up
|
||||
* [Screen wipe](/microbit/lessons/screen-wipe), turn off the LEDs with clear screen
|
||||
* [Blink](/microbit/lessons/blink), turn an LED on and off with plot
|
||||
* [Flashing heart](/microbit/lessons/flashing-heart/tutorial), display images with a pause
|
||||
* [Smiley,](/lessons/smiley) smiley and frowney with show animation
|
||||
* [Lucky 7](/lessons/lucky-7), show a number on the LED screen with show number
|
||||
* [Snowflake fall](/lessons/snowflake-fall), repeat an animation with forever
|
||||
* [Answering machine](/lessons/answering-machine), show a text message with show string
|
||||
* [Bounce image](/lessons/bounce-image), scroll an image across the screen on shake
|
||||
* [Magic logo](/lessons/magic-logo), show an image on logo up
|
||||
* [Screen wipe](/lessons/screen-wipe), turn off the LEDs with clear screen
|
||||
* [Blink](/lessons/blink), turn an LED on and off with plot
|
||||
* [Flashing heart](/lessons/flashing-heart/tutorial), display images with a pause
|
||||
|
||||
### ~
|
||||
|
||||
* [Night light](/microbit/lessons/night-light/tutorial), dim the LEDs with set brightness
|
||||
* [Glowing sword](/microbit/lessons/glowing-sword/tutorial), make a glowing sword with fade in and fade out
|
||||
* [Guess the number](/microbit/lessons/guess-the-number/tutorial), guess a random number with random
|
||||
* [Rock paper scissors](/microbit/lessons/rock-paper-scissors/tutorial), use image offsets with local variables
|
||||
* [Counter](/microbit/lessons/counter/tutorial), display a number with a variable
|
||||
* [Love meter](/microbit/lessons/love-meter/tutorial), create a love meter with on pin pressed
|
||||
* [Night light](/lessons/night-light/tutorial), dim the LEDs with set brightness
|
||||
* [Glowing sword](/lessons/glowing-sword/tutorial), make a glowing sword with fade in and fade out
|
||||
* [Guess the number](/lessons/guess-the-number/tutorial), guess a random number with random
|
||||
* [Rock paper scissors](/lessons/rock-paper-scissors/tutorial), use image offsets with local variables
|
||||
* [Counter](/lessons/counter/tutorial), display a number with a variable
|
||||
* [Love meter](/lessons/love-meter/tutorial), create a love meter with on pin pressed
|
||||
|
||||
### ~column
|
||||
|
||||
## Intermediate Games
|
||||
|
||||
* [Truth or dare](/microbit/lessons/truth-or-dare/tutorial), a game that forces each player to reveal a secret or do something funny with if statement
|
||||
* [Spinner](/microbit/lessons/spinner/tutorial), spin the arrow with multiple if statements
|
||||
* [Die roll](/microbit/lessons/die-roll/tutorial), spin with more if statements
|
||||
* [Looper](/microbit/lessons/looper/tutorial), display a series of numbers with a for loop index
|
||||
* [Strobe light](/microbit/lessons/strobe-light/tutorial), develop shapes with a nested for loops
|
||||
* [Digi yoyo](/microbit/lessons/digi-yoyo/tutorial), create a counter with a while loop
|
||||
* [Magic 8](/microbit/lessons/magic-8/tutorial), a fortune teller game with the BBC micro:bit
|
||||
* [Compass](/microbit/lessons/compass/tutorial), displays the direction the BBC micro:bit is pointing
|
||||
* [Speed button](/microbit/lessons/speed-button/tutorial), code a speed game with running time
|
||||
* [Truth or dare](/lessons/truth-or-dare/tutorial), a game that forces each player to reveal a secret or do something funny with if statement
|
||||
* [Spinner](/lessons/spinner/tutorial), spin the arrow with multiple if statements
|
||||
* [Die roll](/lessons/die-roll/tutorial), spin with more if statements
|
||||
* [Looper](/lessons/looper/tutorial), display a series of numbers with a for loop index
|
||||
* [Strobe light](/lessons/strobe-light/tutorial), develop shapes with a nested for loops
|
||||
* [Digi yoyo](/lessons/digi-yoyo/tutorial), create a counter with a while loop
|
||||
* [Magic 8](/lessons/magic-8/tutorial), a fortune teller game with the BBC micro:bit
|
||||
* [Compass](/lessons/compass/tutorial), displays the direction the BBC micro:bit is pointing
|
||||
* [Speed button](/lessons/speed-button/tutorial), code a speed game with running time
|
||||
|
||||
### ~hide
|
||||
|
||||
* [Zoomer](/microbit/lessons/zoomer/tutorial), measure the force with acceleration
|
||||
* [Rotation animation](/microbit/lessons/rotation-animation/tutorial), control an animation with a boolean variable
|
||||
* [Offset image](/microbit/lessons/offset-image/tutorial), shift an image horizontally with image offset
|
||||
* [Zoomer](/lessons/zoomer/tutorial), measure the force with acceleration
|
||||
* [Rotation animation](/lessons/rotation-animation/tutorial), control an animation with a boolean variable
|
||||
* [Offset image](/lessons/offset-image/tutorial), shift an image horizontally with image offset
|
||||
|
||||
### ~
|
||||
|
||||
@@ -60,30 +60,30 @@ Overview of Games for the BBC micro:bit.
|
||||
|
||||
### ~hide
|
||||
|
||||
* [Digital pet](/microbit/lessons/digital-pet/tutorial), a display of pet images with sub-functions
|
||||
* [Jailbreak](/microbit/lessons/jailbreak/tutorial), break out of a counting loop by pressing button "A"
|
||||
* [Transformers](/microbit/lessons/transformers/tutorial), use functions to return values
|
||||
* [Flipping bird](/microbit/lessons/flipping-bird/tutorial), use modulo with a conditional
|
||||
* [Digital pet](/lessons/digital-pet/tutorial), a display of pet images with sub-functions
|
||||
* [Jailbreak](/lessons/jailbreak/tutorial), break out of a counting loop by pressing button "A"
|
||||
* [Transformers](/lessons/transformers/tutorial), use functions to return values
|
||||
* [Flipping bird](/lessons/flipping-bird/tutorial), use modulo with a conditional
|
||||
|
||||
### ~
|
||||
|
||||
* [Catch the egg](/microbit/lessons/catch-the-egg-game/tutorial), catch falling eggs in a basket with an acceleration controller
|
||||
* [Headbands](/microbit/lessons/headbands/tutorial), create a charades game with a collection of strings that hold the words
|
||||
* [Pong](/microbit/lessons/pong/tutorial), a light bouncing from left to right
|
||||
* [Meteorite](/microbit/lessons/meteorite/tutorial), a game where meteorites are coming for you one by one
|
||||
* [Minesweeper](/microbit/lessons/minesweeper/tutorial), make a game to test your memory for placing a LED mine then finding the hidden LED mine
|
||||
* [Bop it](/microbit/lessons/bop-it/tutorial), a game where you have to keep up with the commands
|
||||
* [Letter Up](/microbit/lessons/letter-up/tutorial), a guessing game with string operators with string at
|
||||
* [Prank WiFi](/microbit/lessons/prank-wifi/tutorial), create fake WiFi to trick your friends
|
||||
* [Runaway pac man](/microbit/lessons/runaway-pacman/tutorial), construct the game pac man with the BBC micro:bit
|
||||
* [The hat game](/microbit/lessons/the-hat-game/tutorial), make a game to test your focus on the moving ball
|
||||
* [2 player pong](/microbit/lessons/2-player-pong/tutorial), collaborate with a classmate to develop Pong on multiple BBC micro:bits
|
||||
* [Catch the egg](/lessons/catch-the-egg-game/tutorial), catch falling eggs in a basket with an acceleration controller
|
||||
* [Headbands](/lessons/headbands/tutorial), create a charades game with a collection of strings that hold the words
|
||||
* [Pong](/lessons/pong/tutorial), a light bouncing from left to right
|
||||
* [Meteorite](/lessons/meteorite/tutorial), a game where meteorites are coming for you one by one
|
||||
* [Minesweeper](/lessons/minesweeper/tutorial), make a game to test your memory for placing a LED mine then finding the hidden LED mine
|
||||
* [Bop it](/lessons/bop-it/tutorial), a game where you have to keep up with the commands
|
||||
* [Letter Up](/lessons/letter-up/tutorial), a guessing game with string operators with string at
|
||||
* [Prank WiFi](/lessons/prank-wifi/tutorial), create fake WiFi to trick your friends
|
||||
* [Runaway pac man](/lessons/runaway-pacman/tutorial), construct the game pac man with the BBC micro:bit
|
||||
* [The hat game](/lessons/the-hat-game/tutorial), make a game to test your focus on the moving ball
|
||||
* [2 player pong](/lessons/2-player-pong/tutorial), collaborate with a classmate to develop Pong on multiple BBC micro:bits
|
||||
|
||||
### ~hide
|
||||
|
||||
* [Glowing pendulum](/microbit/lessons/glowing-pendulum/tutorial), construct a pendulum that glows using acceleration
|
||||
* [Line of Fire](/microbit/lessons/line-of-fire/tutorial), make a game to test hand-eye coordination
|
||||
* [Number psych](/microbit/lessons/number-psych/tutorial), collaborate with multiple classmates to develop a game on multiple BBC micro:bits and a breadboard
|
||||
* [Glowing pendulum](/lessons/glowing-pendulum/tutorial), construct a pendulum that glows using acceleration
|
||||
* [Line of Fire](/lessons/line-of-fire/tutorial), make a game to test hand-eye coordination
|
||||
* [Number psych](/lessons/number-psych/tutorial), collaborate with multiple classmates to develop a game on multiple BBC micro:bits and a breadboard
|
||||
|
||||
### ~
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
### Challenge 0
|
||||
|
||||
You have successfully following the [blink tutorial](/microbit/hcwxud). If not, then let's start the tutorial now. Your micro:bit script should start by displaying a blinking script on screen. We want to plot the x and y coordinates to 2, 2. Additionally, you will pause by 100 milliseconds then clear the screen of the micro:bit.
|
||||
You have successfully following the [blink tutorial](/hcwxud). If not, then let's start the tutorial now. Your micro:bit script should start by displaying a blinking script on screen. We want to plot the x and y coordinates to 2, 2. Additionally, you will pause by 100 milliseconds then clear the screen of the micro:bit.
|
||||
|
||||
Let's give it a go!
|
||||
|
||||
|
@@ -4,7 +4,7 @@ My script. #docs
|
||||
|
||||
**Challenge 0**
|
||||
|
||||
This [guided tutorial](/microbit/xuhkviyyxa) introduces how to make an image look like it's scrolling across the micro:bit!
|
||||
This [guided tutorial](/xuhkviyyxa) introduces how to make an image look like it's scrolling across the micro:bit!
|
||||
|
||||
We can use an animation to make an image look like its moving!
|
||||
|
||||
|
@@ -8,12 +8,12 @@ Overview of TouchDevelop lessons for the micro:bit.
|
||||
|
||||
### LED screen
|
||||
|
||||
* [plot guided](/microbit/hcwxud) `guided tutorial ` `video available`
|
||||
* [plots an LED](/microbit/njuzbvocit) [guided tutorial]
|
||||
* [blink symbols](/microbit/rfchtfjmag) `docs`
|
||||
* [clear screen](/microbit/jwqywu)
|
||||
* [point](/microbit/reference/led/point)
|
||||
* [set brightness](/microbit/tfrmcgdtxk)
|
||||
* [plot guided](/hcwxud) `guided tutorial ` `video available`
|
||||
* [plots an LED](/njuzbvocit) [guided tutorial]
|
||||
* [blink symbols](/rfchtfjmag) `docs`
|
||||
* [clear screen](/jwqywu)
|
||||
* [point](/reference/led/point)
|
||||
* [set brightness](/tfrmcgdtxk)
|
||||
|
||||
## micro:bit
|
||||
|
||||
@@ -21,49 +21,49 @@ Overview of TouchDevelop lessons for the micro:bit.
|
||||
|
||||
### Basic
|
||||
|
||||
* [show number](/microbit/doxhko)
|
||||
* [show string](/microbit/hgsfxg)
|
||||
* [forever - show image](/microbit/bniyze) `guided tutorial`
|
||||
* [forever - show animation - two frames 1a](/microbit/rwsjmubtaa)
|
||||
* [forever - show animation - two frames 1c](/microbit/fomtaxxdkk)
|
||||
* [forever - show animation - two frames 1 d](/microbit/huguhgjmmn)
|
||||
* [forever - show animation - multliple frames](/microbit/tweyhx)
|
||||
* [show number](/doxhko)
|
||||
* [show string](/hgsfxg)
|
||||
* [forever - show image](/bniyze) `guided tutorial`
|
||||
* [forever - show animation - two frames 1a](/rwsjmubtaa)
|
||||
* [forever - show animation - two frames 1c](/fomtaxxdkk)
|
||||
* [forever - show animation - two frames 1 d](/huguhgjmmn)
|
||||
* [forever - show animation - multliple frames](/tweyhx)
|
||||
|
||||
## Language {#pconst}
|
||||
|
||||
### Variables
|
||||
|
||||
* [global variables ](/microbit/nkecii) `guided tutorial`
|
||||
* [local variable - create image, show image](/microbit/dcvnwv)
|
||||
* data types: [number](/microbit/reference/types/number), [boolean](/microbit/reference/types/boolean), [string](/microbit/reference/types/string), [image](/microbit/reference/image/image)
|
||||
* [global variables ](/nkecii) `guided tutorial`
|
||||
* [local variable - create image, show image](/dcvnwv)
|
||||
* data types: [number](/reference/types/number), [boolean](/reference/types/boolean), [string](/reference/types/string), [image](/reference/image/image)
|
||||
|
||||
### Statements and control structures
|
||||
|
||||
* [if](/microbit/reference/logic/if)
|
||||
* [for](/microbit/reference/loops/for)
|
||||
* [for loop nested - plot](/microbit/vpvhdnaqfm) **script**
|
||||
* [while](/microbit/js/while)
|
||||
* [while - show string, show number, show animation](/microbit/bidtzqdips) `docs`
|
||||
* [while - create image ](/microbit/bnqbom)
|
||||
* [return](/microbit/js/return)
|
||||
* [break](/microbit/js/break)
|
||||
* [function](/microbit/js/function)
|
||||
* [assignment operation](/microbit/reference/variables/assign) `:=`
|
||||
* [if](/reference/logic/if)
|
||||
* [for](/reference/loops/for)
|
||||
* [for loop nested - plot](/vpvhdnaqfm) **script**
|
||||
* [while](/js/while)
|
||||
* [while - show string, show number, show animation](/bidtzqdips) `docs`
|
||||
* [while - create image ](/bnqbom)
|
||||
* [return](/js/return)
|
||||
* [break](/js/break)
|
||||
* [function](/js/function)
|
||||
* [assignment operation](/reference/variables/assign) `:=`
|
||||
|
||||
### Maths
|
||||
|
||||
* arithmetic operators (`+`, `-`, `*`, `/`, mod) on [numbers](/microbit/reference/types/number)
|
||||
* comparison operators (such as `>`, `=`) on [numbers](/microbit/reference/types/number)
|
||||
* the [math](/microbit/js/math) library
|
||||
* the [bits](/microbit/js/bits) library
|
||||
* arithmetic operators (`+`, `-`, `*`, `/`, mod) on [numbers](/reference/types/number)
|
||||
* comparison operators (such as `>`, `=`) on [numbers](/reference/types/number)
|
||||
* the [math](/js/math) library
|
||||
* the [bits](/js/bits) library
|
||||
|
||||
### Logical
|
||||
|
||||
* boolean operators (`not`, `or`, `and`) on [booleans](/microbit/reference/types/boolean)
|
||||
* boolean operators (`not`, `or`, `and`) on [booleans](/reference/types/boolean)
|
||||
|
||||
### Strings
|
||||
|
||||
* concat operator combines [strings](/microbit/reference/types/string)
|
||||
* concat operator combines [strings](/reference/types/string)
|
||||
|
||||
### ~
|
||||
|
||||
@@ -71,17 +71,17 @@ Overview of TouchDevelop lessons for the micro:bit.
|
||||
|
||||
### Input
|
||||
|
||||
* [button is pressed](/microbit/reference/input/button-is-pressed)
|
||||
* [on button pressed](/microbit/reference/input/on-button-pressed)
|
||||
* [acceleration](/microbit/reference/input/acceleration)
|
||||
* [compass heading](/microbit/reference/input/compass-heading)
|
||||
* [calibrate](/microbit/functions/calibrate)
|
||||
* [running time](/microbit/reference/input/running-time)
|
||||
* [on shake](/microbit/reference/input/on-gesture)
|
||||
* [on screen up](/microbit/functions/on-screen-up)
|
||||
* [on screen down](/microbit/functions/on-screen-down)
|
||||
* [on logo up](/microbit/functions/on-logo-up)
|
||||
* [on logo down](/microbit/functions/on-logo-down)
|
||||
* [button is pressed](/reference/input/button-is-pressed)
|
||||
* [on button pressed](/reference/input/on-button-pressed)
|
||||
* [acceleration](/reference/input/acceleration)
|
||||
* [compass heading](/reference/input/compass-heading)
|
||||
* [calibrate](/functions/calibrate)
|
||||
* [running time](/reference/input/running-time)
|
||||
* [on shake](/reference/input/on-gesture)
|
||||
* [on screen up](/functions/on-screen-up)
|
||||
* [on screen down](/functions/on-screen-down)
|
||||
* [on logo up](/functions/on-logo-up)
|
||||
* [on logo down](/functions/on-logo-down)
|
||||
|
||||
### ~
|
||||
|
||||
@@ -89,42 +89,42 @@ Overview of TouchDevelop lessons for the micro:bit.
|
||||
|
||||
### Authoring & Other Bits
|
||||
|
||||
* [TouchDevelop editor](/microbit/js/editor)
|
||||
* [markdown](/microbit/js/markdown)
|
||||
* [creating interactive tutorials](/microbit/js/creatinginteractivetutorials)
|
||||
* [run scripts in a web browser](/microbit/js/simulator)
|
||||
* [run scripts on your micro:bit](/microbit/usb)
|
||||
* [libraries](/microbit/js/libraries)
|
||||
* [TouchDevelop editor](/js/editor)
|
||||
* [markdown](/js/markdown)
|
||||
* [creating interactive tutorials](/js/creatinginteractivetutorials)
|
||||
* [run scripts in a web browser](/js/simulator)
|
||||
* [run scripts on your micro:bit](/usb)
|
||||
* [libraries](/js/libraries)
|
||||
|
||||
### Functions and libraries
|
||||
|
||||
* [creating functions](/microbit/js/function)
|
||||
* [function parameters](/microbit/js/functionparameters)
|
||||
* [calling functions](/microbit/js/call)
|
||||
* [libraries](/microbit/js/libraries)
|
||||
* [creating functions](/js/function)
|
||||
* [function parameters](/js/functionparameters)
|
||||
* [calling functions](/js/call)
|
||||
* [libraries](/js/libraries)
|
||||
|
||||
### Images
|
||||
|
||||
* [create image](/microbit/reference/images/create-image)
|
||||
* [clear](/microbit/reference/basic/clear-screen)
|
||||
* [set pixel](/microbit/reference/images/set-pixel)
|
||||
* [pixel](/microbit/reference/images/pixel)
|
||||
* [show image](/microbit/reference/images/show-image)
|
||||
* [scroll image](/microbit/reference/images/scroll-image)
|
||||
* [width](/microbit/functions/width)
|
||||
* [show animation](/microbit/reference/basic/show-animation)
|
||||
* [create image](/reference/images/create-image)
|
||||
* [clear](/reference/basic/clear-screen)
|
||||
* [set pixel](/reference/images/set-pixel)
|
||||
* [pixel](/reference/images/pixel)
|
||||
* [show image](/reference/images/show-image)
|
||||
* [scroll image](/reference/images/scroll-image)
|
||||
* [width](/functions/width)
|
||||
* [show animation](/reference/basic/show-animation)
|
||||
|
||||
### Pins
|
||||
|
||||
* [analog read pin](/microbit/reference/pins/analog-read-pin)
|
||||
* [analog write pin](/microbit/reference/pins/analog-write-pin)
|
||||
* [digital read pin](/microbit/reference/pins/digital-read-pin)
|
||||
* [digital write pin](/microbit/reference/pins/digital-write-pin)
|
||||
* [analog read pin](/reference/pins/analog-read-pin)
|
||||
* [analog write pin](/reference/pins/analog-write-pin)
|
||||
* [digital read pin](/reference/pins/digital-read-pin)
|
||||
* [digital write pin](/reference/pins/digital-write-pin)
|
||||
|
||||
### Accessories
|
||||
|
||||
* [forever](/microbit/reference/basic/forever)
|
||||
* [in background](/microbit/reference/control/in-background)
|
||||
* [forever](/reference/basic/forever)
|
||||
* [in background](/reference/control/in-background)
|
||||
|
||||
## Tutorials
|
||||
|
||||
|
@@ -30,22 +30,22 @@ The BBC micro:bit can be used to run an Hour Of Code™ events for beginner of a
|
||||
|
||||
Print the following **activities** (1 handout per student):
|
||||
|
||||
* [answering machine](/microbit/lessons/answering-machine/activity)
|
||||
* [happy birthday](/microbit/lessons/happy-birthday/activity)
|
||||
* [love meter](/microbit/lessons/love-meter/activity)
|
||||
* [answering machine](/lessons/answering-machine/activity)
|
||||
* [happy birthday](/lessons/happy-birthday/activity)
|
||||
* [love meter](/lessons/love-meter/activity)
|
||||
|
||||
Print the following **challenges** (1 handout per student):
|
||||
|
||||
* [answering machine](/microbit/lessons/answering-machine/challenges)
|
||||
* [happy birthday](/microbit/lessons/happy-birthday/challenges)
|
||||
* [love meter](/microbit/lessons/love-meter/challenges)
|
||||
* [answering machine](/lessons/answering-machine/challenges)
|
||||
* [happy birthday](/lessons/happy-birthday/challenges)
|
||||
* [love meter](/lessons/love-meter/challenges)
|
||||
|
||||
## Timeline
|
||||
|
||||
* ``00:00`` students enter the website address (see step 3)
|
||||
* ``10:00`` [answering machine](/microbit/lessons/answering-machine/activity)
|
||||
* ``25:00`` [happy birthday](/microbit/lessons/happy-birthday/activity)
|
||||
* ``35:00`` [love meter](/microbit/lessons/love-meter/activity)
|
||||
* ``10:00`` [answering machine](/lessons/answering-machine/activity)
|
||||
* ``25:00`` [happy birthday](/lessons/happy-birthday/activity)
|
||||
* ``35:00`` [love meter](/lessons/love-meter/activity)
|
||||
* ``55:00`` raffle
|
||||
* ``60:00`` that's it!
|
||||
|
||||
@@ -53,7 +53,7 @@ Print the following **challenges** (1 handout per student):
|
||||
|
||||
After your Hour Of Code™, you will want to provide plenty of material for students to continue learning about coding. Here are some good places to start:
|
||||
|
||||
* [more challenges](/microbit/js/games) are available with BBC micro:bit Tutorials
|
||||
* [more challenges](/js/games) are available with BBC micro:bit Tutorials
|
||||
* [the Quick Start Guide for Teachers](http://www.slideshare.net/Microsofteduk/bbc-microbit-guide-from-hodder-education) are available within BBC micro:bit
|
||||
|
||||
The 'Hour of Code™' is a nationwide initiative by [Computer Science Education Week](http://csedweek.org) and [Code.org](http://code.org) to introduce millions of students to one hour of computer science and computer programming.
|
||||
|
@@ -20,7 +20,7 @@ Create a classroom in https://www.microbit.co.uk and pre-populate the classroom
|
||||
|
||||
4) Print the activity challenges (1 copy per participant):
|
||||
|
||||
* [hour of code](/microbit/js/hourofcode/challenges)
|
||||
* [hour of code](/js/hourofcode/challenges)
|
||||
|
||||
4) (optional) Raffle tickets and prizes
|
||||
|
||||
@@ -33,7 +33,7 @@ Bring more energy in the room by playing music.
|
||||
## Timeline
|
||||
|
||||
* ``00:00`` student sign in using **printed passwords** (see step 3)
|
||||
* ``10:00`` [hour of code tutorial](/microbit/js/hourofcode)
|
||||
* ``10:00`` [hour of code tutorial](/js/hourofcode)
|
||||
* ``40:00`` raffle and demoes
|
||||
* ``50:00`` that's it!
|
||||
|
||||
@@ -41,7 +41,7 @@ Bring more energy in the room by playing music.
|
||||
|
||||
After your Hour Of Code™, you will want to provide plenty of material for students to continue learning about coding. Here are some good places to start:
|
||||
|
||||
* [more challenges](/microbit/lessonss) are available for BBC micro:bit
|
||||
* [more challenges](/lessonss) are available for BBC micro:bit
|
||||
* [the Quick Start Guide for Teachers](http://www.slideshare.net/Microsofteduk/bbc-microbit-guide-from-hodder-education) are available within BBC micro:bit
|
||||
|
||||
_The Hour of Code™ is a nationwide initiative by [Computer Science Education Week](http://csedweek.org) and [Code.org](http://code.org) to introduce millions of students to one hour of computer science and computer programming._
|
||||
|
@@ -5,7 +5,7 @@ Run code based on a condition.
|
||||
### @parent js/language
|
||||
|
||||
|
||||
Conditionally run code depending on whether a [Boolean](/microbit/reference/types/boolean) condition is true or false.
|
||||
Conditionally run code depending on whether a [Boolean](/reference/types/boolean) condition is true or false.
|
||||
|
||||
### Block Editor
|
||||
|
||||
@@ -33,7 +33,7 @@ if (condition) {
|
||||
|
||||
### Example: adjusting screen brightness
|
||||
|
||||
If the screen [brightness](/microbit/reference/led/brightness) is `< 100`, this code sets the brightness to `255`:
|
||||
If the screen [brightness](/reference/led/brightness) is `< 100`, this code sets the brightness to `255`:
|
||||
|
||||
```
|
||||
if (led.brightness() < 100) {
|
||||
@@ -68,7 +68,7 @@ else {
|
||||
|
||||
### Example: compass heading
|
||||
|
||||
The following example gets the [compass heading](/microbit/reference/input/compass-heading) and then uses ``if-then-else`` statements to display a letter on the screen (N for north, E for East, S for South, and W for West).
|
||||
The following example gets the [compass heading](/reference/input/compass-heading) and then uses ``if-then-else`` statements to display a letter on the screen (N for north, E for East, S for South, and W for West).
|
||||
|
||||
```
|
||||
while (true) {
|
||||
@@ -93,9 +93,9 @@ You can move an entire ``if`` block by clicking the ``if`` keyword and dragging
|
||||
|
||||
### Lessons
|
||||
|
||||
[love meter](/microbit/lessons/love-meter), [zoomer](/microbit/lessons/zoomer), [offset image](/microbit/lessons/offset-image)
|
||||
[love meter](/lessons/love-meter), [zoomer](/lessons/zoomer), [offset image](/lessons/offset-image)
|
||||
|
||||
### See also
|
||||
|
||||
[while loop](/microbit/js/while), [for](/microbit/reference/loops/for), [boolean](/microbit/reference/types/boolean)
|
||||
[while loop](/js/while), [for](/reference/loops/for), [boolean](/reference/types/boolean)
|
||||
|
||||
|
@@ -4,11 +4,11 @@ An image for the micro:bit screen.
|
||||
|
||||
### @parent js/language
|
||||
|
||||
An *Image* is a matrix of pixels to show on the [LED screen](/microbit/device/screen)
|
||||
An *Image* is a matrix of pixels to show on the [LED screen](/device/screen)
|
||||
|
||||
### Touch Develop editor: plot an image
|
||||
|
||||
To display an image using the [Touch Develop editor](/microbit/js/editor):
|
||||
To display an image using the [Touch Develop editor](/js/editor):
|
||||
|
||||
* click `image` , `plot image`, and then `edit`
|
||||
* click the rectangles to create an image
|
||||
@@ -30,11 +30,11 @@ basic.plotImage(`
|
||||
|
||||
### Creating an image
|
||||
|
||||
To create an image that you can later modify, see the [create image](/microbit/reference/images/create-image) function.
|
||||
To create an image that you can later modify, see the [create image](/reference/images/create-image) function.
|
||||
|
||||
### Block editor: create and show images
|
||||
|
||||
To create images using the [Block editor](/microbit/blocks/editor):
|
||||
To create images using the [Block editor](/blocks/editor):
|
||||
|
||||
1. Click the **Images** category on the left.
|
||||
|
||||
@@ -46,26 +46,26 @@ To create images using the [Block editor](/microbit/blocks/editor):
|
||||
|
||||
### Global image variables
|
||||
|
||||
Images that you create in the [Touch Develop editor](/microbit/js/editor) are [local variables](/microbit/reference/variables/var). To promote a local image variable to a global variable, select the local image variable and click `promote to data`. The *var* keyword changes to the [data](/microbit/js/data) symbol `data->`.
|
||||
Images that you create in the [Touch Develop editor](/js/editor) are [local variables](/reference/variables/var). To promote a local image variable to a global variable, select the local image variable and click `promote to data`. The *var* keyword changes to the [data](/js/data) symbol `data->`.
|
||||
|
||||
### Image functions
|
||||
|
||||
* [create image](/microbit/reference/images/create-image): create an image from a series of on/off LED states
|
||||
* [clear](/microbit/reference/basic/clear-screen): turn off all the pixels in an image
|
||||
* [set pixel](/microbit/reference/images/set-pixel): set the state of a pixel in an image
|
||||
* [pixel](/microbit/reference/images/pixel): get the state of a pixel in an image
|
||||
* [plot-image](/microbit/reference/led/plot-image): show a single-frame image on the LED screen
|
||||
* [show animation](/microbit/reference/basic/show-animation): show a series of image frames
|
||||
* [show image](/microbit/reference/images/show-image): show an image on the screen
|
||||
* [scroll image](/microbit/reference/images/scroll-image): scroll an image on the screen
|
||||
* [width](/microbit/functions/width): get the width of an image
|
||||
* [create image](/reference/images/create-image): create an image from a series of on/off LED states
|
||||
* [clear](/reference/basic/clear-screen): turn off all the pixels in an image
|
||||
* [set pixel](/reference/images/set-pixel): set the state of a pixel in an image
|
||||
* [pixel](/reference/images/pixel): get the state of a pixel in an image
|
||||
* [plot-image](/reference/led/plot-image): show a single-frame image on the LED screen
|
||||
* [show animation](/reference/basic/show-animation): show a series of image frames
|
||||
* [show image](/reference/images/show-image): show an image on the screen
|
||||
* [scroll image](/reference/images/scroll-image): scroll an image on the screen
|
||||
* [width](/functions/width): get the width of an image
|
||||
|
||||
### Lessons
|
||||
|
||||
* [bounce image ](/microbit/lessons/bounce-image)
|
||||
* [offset image](/microbit/lessons/offset-image)
|
||||
* [bounce image ](/lessons/bounce-image)
|
||||
* [offset image](/lessons/offset-image)
|
||||
|
||||
### See also
|
||||
|
||||
[plot image](/microbit/reference/led/plot-image), [create image](/microbit/reference/images/create-image), [show image](/microbit/reference/images/show-image), [LED screen](/microbit/device/screen)
|
||||
[plot image](/reference/led/plot-image), [create image](/reference/images/create-image), [show image](/reference/images/show-image), [LED screen](/device/screen)
|
||||
|
||||
|
@@ -8,53 +8,53 @@ Overview of Touch Develop lessons for the BBC micro:bit.
|
||||
|
||||
## Maker
|
||||
|
||||
* [The Watch](/microbit/lessons/the-watch), design and create The Watch
|
||||
* [Hack your Headphones](/microbit/lessons/hack-your-headphones), create music on the BBC micro:bit by hacking your headphones
|
||||
* [Banana Keyboard](/microbit/lessons/banana-keyboard), create music with fruits
|
||||
* [Telegraph](/microbit/lessons/telegraph), play the telegraph game between 2 BBC micro:bits
|
||||
* [Ornament Chain](/microbit/lessons/ornament-chain), play the ornament chain game between 2 BBC micro:bits
|
||||
* [The Watch](/lessons/the-watch), design and create The Watch
|
||||
* [Hack your Headphones](/lessons/hack-your-headphones), create music on the BBC micro:bit by hacking your headphones
|
||||
* [Banana Keyboard](/lessons/banana-keyboard), create music with fruits
|
||||
* [Telegraph](/lessons/telegraph), play the telegraph game between 2 BBC micro:bits
|
||||
* [Ornament Chain](/lessons/ornament-chain), play the ornament chain game between 2 BBC micro:bits
|
||||
|
||||
## Beginner
|
||||
|
||||
* [Beautiful Image](/microbit/lessons/beautiful-image), show a beautiful image with show LEDs
|
||||
* [Smiley,](/microbit/lessons/smiley) smiley and frowney with show animation
|
||||
* [Lucky 7](/microbit/lessons/lucky-7), show a number on the LED screen with show number
|
||||
* [Answering Machine](/microbit/lessons/answering-machine), show a text message with show string
|
||||
* [Snowflake Fall](/microbit/lessons/snowflake-fall), repeat an animation with forever
|
||||
* [Beautiful Image](/lessons/beautiful-image), show a beautiful image with show LEDs
|
||||
* [Smiley,](/lessons/smiley) smiley and frowney with show animation
|
||||
* [Lucky 7](/lessons/lucky-7), show a number on the LED screen with show number
|
||||
* [Answering Machine](/lessons/answering-machine), show a text message with show string
|
||||
* [Snowflake Fall](/lessons/snowflake-fall), repeat an animation with forever
|
||||
|
||||
### ~hide
|
||||
|
||||
* [Bounce Image](/microbit/lessons/bounce-image), scroll an image across the screen on shake
|
||||
* [Bounce Image](/lessons/bounce-image), scroll an image across the screen on shake
|
||||
|
||||
### ~
|
||||
|
||||
* [Magic Logo](/microbit/lessons/magic-logo), show an image on logo up
|
||||
* [Screen Wipe](/microbit/lessons/screen-wipe), turn off the LEDs with clear screen
|
||||
* [Flashing Heart](/microbit/lessons/flashing-heart), display images with a pause
|
||||
* [Blink](/microbit/lessons/blink), turn an LED on and off with plot
|
||||
* [Night Light](/microbit/lessons/night-light), dim the LEDs with set brightness
|
||||
* [Glowing Sword](/microbit/lessons/glowing-sword), make a glowing sword with fade in and fade out
|
||||
* [Magic Logo](/lessons/magic-logo), show an image on logo up
|
||||
* [Screen Wipe](/lessons/screen-wipe), turn off the LEDs with clear screen
|
||||
* [Flashing Heart](/lessons/flashing-heart), display images with a pause
|
||||
* [Blink](/lessons/blink), turn an LED on and off with plot
|
||||
* [Night Light](/lessons/night-light), dim the LEDs with set brightness
|
||||
* [Glowing Sword](/lessons/glowing-sword), make a glowing sword with fade in and fade out
|
||||
|
||||
### ~column
|
||||
|
||||
## Intermediate
|
||||
|
||||
* [Magic 8](/microbit/lessons/magic-8), a fortune teller game with the BBC micro:bit
|
||||
* [Guess the Number](/microbit/lessons/guess-the-number), guess a random number with random
|
||||
* [Rock Paper Scissors](/microbit/lessons/rock-paper-scissors), use image offsets with local variables
|
||||
* [Counter](/microbit/lessons/counter), display a number with a variable
|
||||
* [Love meter](/microbit/lessons/love-meter), create a love meter with on pin pressed
|
||||
* [Zoomer](/microbit/lessons/zoomer), measure the force with acceleration
|
||||
* [Glowing Pendulum](/microbit/lessons/glowing-pendulum), construct a pendulum that glows using acceleration
|
||||
* [Truth or Dare](/microbit/lessons/truth-or-dare), a game that forces each player to reveal a secret or do something funny with if statement
|
||||
* [Spinner](/microbit/lessons/spinner), spin the arrow with multiple if statements
|
||||
* [Die Roll](/microbit/lessons/die-roll), spin with more if statements
|
||||
* [Looper](/microbit/lessons/looper), display a series of numbers with a for loop index
|
||||
* [Strobe Light](/microbit/lessons/strobe-light), develop shapes with a nested for loops
|
||||
* [Digi Yoyo](/microbit/lessons/digi-yoyo), create a counter with a while loop
|
||||
* [Rotation Animation](/microbit/lessons/rotation-animation), control an animation with a boolean variable
|
||||
* [Offset Image](/microbit/lessons/offset-image), shift an image horizontally with image offset
|
||||
* [Compass](/microbit/lessons/compass), displays the direction the BBC micro:bit is pointing
|
||||
* [Magic 8](/lessons/magic-8), a fortune teller game with the BBC micro:bit
|
||||
* [Guess the Number](/lessons/guess-the-number), guess a random number with random
|
||||
* [Rock Paper Scissors](/lessons/rock-paper-scissors), use image offsets with local variables
|
||||
* [Counter](/lessons/counter), display a number with a variable
|
||||
* [Love meter](/lessons/love-meter), create a love meter with on pin pressed
|
||||
* [Zoomer](/lessons/zoomer), measure the force with acceleration
|
||||
* [Glowing Pendulum](/lessons/glowing-pendulum), construct a pendulum that glows using acceleration
|
||||
* [Truth or Dare](/lessons/truth-or-dare), a game that forces each player to reveal a secret or do something funny with if statement
|
||||
* [Spinner](/lessons/spinner), spin the arrow with multiple if statements
|
||||
* [Die Roll](/lessons/die-roll), spin with more if statements
|
||||
* [Looper](/lessons/looper), display a series of numbers with a for loop index
|
||||
* [Strobe Light](/lessons/strobe-light), develop shapes with a nested for loops
|
||||
* [Digi Yoyo](/lessons/digi-yoyo), create a counter with a while loop
|
||||
* [Rotation Animation](/lessons/rotation-animation), control an animation with a boolean variable
|
||||
* [Offset Image](/lessons/offset-image), shift an image horizontally with image offset
|
||||
* [Compass](/lessons/compass), displays the direction the BBC micro:bit is pointing
|
||||
|
||||
### ~
|
||||
|
||||
@@ -62,36 +62,36 @@ Overview of Touch Develop lessons for the BBC micro:bit.
|
||||
|
||||
## Advanced
|
||||
|
||||
* [Digital Pet](/microbit/lessons/digital-pet), a display of pet images with sub-functions
|
||||
* [Transformers](/microbit/lessons/transformers), use functions to return values
|
||||
* [Speed Button](/microbit/lessons/speed-button), code a speed game with running time
|
||||
* [Catch the Egg](/microbit/lessons/catch-the-egg-game), catch falling eggs in a basket with an acceleration controller
|
||||
* [Headbands](/microbit/lessons/headbands), create a charades game with a collection of strings that hold the words
|
||||
* [Prank WiFi](/microbit/lessons/prank-wifi), create fake WiFi to trick your friends
|
||||
* [Jailbreak](/microbit/lessons/jailbreak), break out of a counting loop by pressing button "A"
|
||||
* [Flipping Bird](/microbit/lessons/flipping-bird), use modulo with a conditional
|
||||
* [Runaway Pac Man](/microbit/lessons/runaway-pacman), construct the game pac man with the BBC micro:bit
|
||||
* [Line of Fire](/microbit/lessons/line-of-fire), make a game to test hand-eye coordination
|
||||
* [The Hat Game](/microbit/lessons/the-hat-game), make a game to test your focus on the moving ball
|
||||
* [2 Player Pong](/microbit/lessons/2-player-pong), collaborate with a classmate to develop Pong on multiple BBC micro:bits
|
||||
* [Digital Pet](/lessons/digital-pet), a display of pet images with sub-functions
|
||||
* [Transformers](/lessons/transformers), use functions to return values
|
||||
* [Speed Button](/lessons/speed-button), code a speed game with running time
|
||||
* [Catch the Egg](/lessons/catch-the-egg-game), catch falling eggs in a basket with an acceleration controller
|
||||
* [Headbands](/lessons/headbands), create a charades game with a collection of strings that hold the words
|
||||
* [Prank WiFi](/lessons/prank-wifi), create fake WiFi to trick your friends
|
||||
* [Jailbreak](/lessons/jailbreak), break out of a counting loop by pressing button "A"
|
||||
* [Flipping Bird](/lessons/flipping-bird), use modulo with a conditional
|
||||
* [Runaway Pac Man](/lessons/runaway-pacman), construct the game pac man with the BBC micro:bit
|
||||
* [Line of Fire](/lessons/line-of-fire), make a game to test hand-eye coordination
|
||||
* [The Hat Game](/lessons/the-hat-game), make a game to test your focus on the moving ball
|
||||
* [2 Player Pong](/lessons/2-player-pong), collaborate with a classmate to develop Pong on multiple BBC micro:bits
|
||||
|
||||
### Games
|
||||
|
||||
* [Pong](/microbit/lessons/pong), a light bouncing from left to right
|
||||
* [Meteorite](/microbit/lessons/meteorite), a game where meteorites are coming for you one by one
|
||||
* [Minesweeper](/microbit/lessons/minesweeper), make a game to test your memory for placing a LED mine then finding the hidden LED mine
|
||||
* [Bop it](/microbit/lessons/bop-it), a game where you have to keep up with the commands
|
||||
* [Letter up](/microbit/lessons/letter-up), a guessing game with string operators with string at
|
||||
* [Pong](/lessons/pong), a light bouncing from left to right
|
||||
* [Meteorite](/lessons/meteorite), a game where meteorites are coming for you one by one
|
||||
* [Minesweeper](/lessons/minesweeper), make a game to test your memory for placing a LED mine then finding the hidden LED mine
|
||||
* [Bop it](/lessons/bop-it), a game where you have to keep up with the commands
|
||||
* [Letter up](/lessons/letter-up), a guessing game with string operators with string at
|
||||
|
||||
### ~
|
||||
|
||||
### ~hide
|
||||
|
||||
* [Number Psych](/microbit/lessons/number-psych), collaborate with multiple classmates to develop a game on multiple BBC micro:bits and a breadboard
|
||||
* [Number Psych](/lessons/number-psych), collaborate with multiple classmates to develop a game on multiple BBC micro:bits and a breadboard
|
||||
|
||||
### ~
|
||||
|
||||
### @section full
|
||||
|
||||
The lessons promote computational thinking and computer science literacy[ read more...](/microbit/lessons/teach)
|
||||
The lessons promote computational thinking and computer science literacy[ read more...](/lessons/teach)
|
||||
|
||||
|
@@ -8,7 +8,7 @@ Functions
|
||||
|
||||
## Quick Links
|
||||
|
||||
* [tutorial](/microbit/lessons/2-player-pong/tutorial)
|
||||
* [tutorial](/lessons/2-player-pong/tutorial)
|
||||
|
||||
## Class
|
||||
|
||||
@@ -36,15 +36,15 @@ Learn how to create **functions**, `function()` as a unit of code that performs
|
||||
|
||||
## Documentation
|
||||
|
||||
* **functions** : [read more...](/microbit/js/function)
|
||||
* **on button pressed** : [read more...](/microbit/reference/input/on-button-pressed)
|
||||
* **for** : [read more...](/microbit/reference/loops/for)
|
||||
* **if** : [read more...](/microbit/reference/logic/if)
|
||||
* **show animation** : [read more...](/microbit/reference/basic/show-animation)
|
||||
* **functions** : [read more...](/js/function)
|
||||
* **on button pressed** : [read more...](/reference/input/on-button-pressed)
|
||||
* **for** : [read more...](/reference/loops/for)
|
||||
* **if** : [read more...](/reference/logic/if)
|
||||
* **show animation** : [read more...](/reference/basic/show-animation)
|
||||
|
||||
## Resources
|
||||
|
||||
* Activity: [tutorial](/microbit/lessons/2-player-pong/tutorial)
|
||||
* Activity: [tutorial](/lessons/2-player-pong/tutorial)
|
||||
|
||||
## Objectives
|
||||
|
||||
@@ -95,7 +95,7 @@ Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algor
|
||||
## Activity
|
||||
|
||||
* time: 20 min.
|
||||
* [tutorial](/microbit/lessons/2-player-pong/tutorial)
|
||||
* [tutorial](/lessons/2-player-pong/tutorial)
|
||||
|
||||
## Intended follow on
|
||||
|
||||
|
@@ -6,7 +6,7 @@ a two-player game of Pong using TWO BBC micro:bits!.
|
||||
|
||||
## Directions
|
||||
|
||||
Use this activity document to guide your work in the [2 player pong tutorial](/microbit/lessons/2-player-pong/tutorial)
|
||||
Use this activity document to guide your work in the [2 player pong tutorial](/lessons/2-player-pong/tutorial)
|
||||
|
||||
Answer the questions while completing the tutorial. Pay attention to the dialogues!
|
||||
|
||||
|
@@ -6,7 +6,7 @@ a two-player game of Pong using TWO BBC micro:bits!.
|
||||
|
||||
## Directions
|
||||
|
||||
Use this activity document to guide your work in the [2 player pong tutorial](/microbit/lessons/2-player-pong/tutorial)
|
||||
Use this activity document to guide your work in the [2 player pong tutorial](/lessons/2-player-pong/tutorial)
|
||||
|
||||
Answer the questions while completing the tutorial. Pay attention to the dialogues!
|
||||
|
||||
|
@@ -10,11 +10,11 @@ Show String
|
||||
|
||||
## Quick Links
|
||||
|
||||
* [activity](/microbit/lessons/answering-machine/activity)
|
||||
* [quiz](/microbit/lessons/answering-machine/quiz)
|
||||
* [quiz answers](/microbit/lessons/answering-machine/quiz-answers)
|
||||
* [challenges](/microbit/lessons/answering-machine/challenges)
|
||||
* [tutorial](/microbit/lessons/answering-machine/tutorial)
|
||||
* [activity](/lessons/answering-machine/activity)
|
||||
* [quiz](/lessons/answering-machine/quiz)
|
||||
* [quiz answers](/lessons/answering-machine/quiz-answers)
|
||||
* [challenges](/lessons/answering-machine/challenges)
|
||||
* [tutorial](/lessons/answering-machine/tutorial)
|
||||
|
||||
## Class
|
||||
|
||||
@@ -26,8 +26,8 @@ Learn how to creating a message with a **string**, `basic->show string` to write
|
||||
|
||||
## Documentation
|
||||
|
||||
* **show string** : [read more...](/microbit/reference/basic/show-string)
|
||||
* **on button pressed** : [read more...](/microbit/reference/input/on-button-pressed)
|
||||
* **show string** : [read more...](/reference/basic/show-string)
|
||||
* **on button pressed** : [read more...](/reference/input/on-button-pressed)
|
||||
|
||||
## Objectives
|
||||
|
||||
@@ -67,15 +67,15 @@ Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algor
|
||||
## Activity
|
||||
|
||||
* time: 20 min.
|
||||
* [activity](/microbit/lessons/answering-machine/activity)
|
||||
* [quiz](/microbit/lessons/answering-machine/quiz)
|
||||
* [activity](/lessons/answering-machine/activity)
|
||||
* [quiz](/lessons/answering-machine/quiz)
|
||||
|
||||
## Extended Activity
|
||||
|
||||
* time: 20 min.
|
||||
* [challenges](/microbit/lessons/answering-machine/challenges)
|
||||
* [challenges](/lessons/answering-machine/challenges)
|
||||
|
||||
## Homework
|
||||
|
||||
* Extended Activity: [challenges](/microbit/lessons/answering-machine/challenges)
|
||||
* Extended Activity: [challenges](/lessons/answering-machine/challenges)
|
||||
|
||||
|
@@ -8,7 +8,7 @@ Music
|
||||
|
||||
## Quick Links
|
||||
|
||||
* [activity](/microbit/lessons/banana-keyboard/activity)
|
||||
* [activity](/lessons/banana-keyboard/activity)
|
||||
|
||||
## Class
|
||||
|
||||
|
@@ -10,11 +10,11 @@ Show LEDs
|
||||
|
||||
## Quick Links
|
||||
|
||||
* [activity](/microbit/lessons/beautiful-image/activity)
|
||||
* [quiz](/microbit/lessons/beautiful-image/quiz)
|
||||
* [quiz answers](/microbit/lessons/beautiful-image/quiz-answers)
|
||||
* [challenges](/microbit/lessons/beautiful-image/challenges)
|
||||
* [tutorial](/microbit/lessons/beautiful-image/tutorial)
|
||||
* [activity](/lessons/beautiful-image/activity)
|
||||
* [quiz](/lessons/beautiful-image/quiz)
|
||||
* [quiz answers](/lessons/beautiful-image/quiz-answers)
|
||||
* [challenges](/lessons/beautiful-image/challenges)
|
||||
* [tutorial](/lessons/beautiful-image/tutorial)
|
||||
|
||||
## Class
|
||||
|
||||
@@ -26,8 +26,8 @@ Learn how to **show LEDs**, to show an image on the BBC micro:bit's LED screen.
|
||||
|
||||
## Documentation
|
||||
|
||||
* **show LEDs** : [read more...](/microbit/reference/basic/show-leds)
|
||||
* **pause** : [read more...](/microbit/reference/basic/pause)
|
||||
* **show LEDs** : [read more...](/reference/basic/show-leds)
|
||||
* **pause** : [read more...](/reference/basic/pause)
|
||||
|
||||
## Objectives
|
||||
|
||||
@@ -62,15 +62,15 @@ Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algor
|
||||
## Activity
|
||||
|
||||
* time: 20 min.
|
||||
* [tutorial](/microbit/lessons/beautiful-image/tutorial)
|
||||
* [quiz](/microbit/lessons/beautiful-image/quiz)
|
||||
* [tutorial](/lessons/beautiful-image/tutorial)
|
||||
* [quiz](/lessons/beautiful-image/quiz)
|
||||
|
||||
## Extended Activity
|
||||
|
||||
* time: 20 min.
|
||||
* [challenges](/microbit/lessons/beautiful-image/challenges)
|
||||
* [challenges](/lessons/beautiful-image/challenges)
|
||||
|
||||
## Homework
|
||||
|
||||
* Extended Activity: [challenges](/microbit/lessons/beautiful-image/challenges)
|
||||
* Extended Activity: [challenges](/lessons/beautiful-image/challenges)
|
||||
|
||||
|
@@ -10,11 +10,11 @@ Plot
|
||||
|
||||
## Quick links
|
||||
|
||||
* [activity](/microbit/lessons/blink/activity)
|
||||
* [quiz](/microbit/lessons/blink/quiz)
|
||||
* [quiz answers](/microbit/lessons/blink/quiz-answers)
|
||||
* [challenges](/microbit/lessons/blink/challenges)
|
||||
* [tutorial](/microbit/lessons/blink/tutorial)
|
||||
* [activity](/lessons/blink/activity)
|
||||
* [quiz](/lessons/blink/quiz)
|
||||
* [quiz answers](/lessons/blink/quiz-answers)
|
||||
* [challenges](/lessons/blink/challenges)
|
||||
* [tutorial](/lessons/blink/tutorial)
|
||||
|
||||
## Class
|
||||
|
||||
@@ -36,16 +36,16 @@ Learn how to control a blinking LED. We will be learning how to create a blinkin
|
||||
|
||||
## Documentation
|
||||
|
||||
* **plot**: [read more...](/microbit/reference/led/plot)
|
||||
* **unplot**: [read more...](/microbit/reference/led/unplot)
|
||||
* **pause**: [read more...](/microbit/reference/basic/pause)
|
||||
* **forever**: [read more...](/microbit/reference/basic/forever)
|
||||
* **plot**: [read more...](/reference/led/plot)
|
||||
* **unplot**: [read more...](/reference/led/unplot)
|
||||
* **pause**: [read more...](/reference/basic/pause)
|
||||
* **forever**: [read more...](/reference/basic/forever)
|
||||
|
||||
## Resources
|
||||
|
||||
* Activity: [tutorial](/microbit/lessons/blink/tutorial)
|
||||
* Activity: [quiz](/microbit/lessons/blink/quiz)
|
||||
* Extended Activity: [challenges](/microbit/lessons/blink/challenges)
|
||||
* Activity: [tutorial](/lessons/blink/tutorial)
|
||||
* Activity: [quiz](/lessons/blink/quiz)
|
||||
* Extended Activity: [challenges](/lessons/blink/challenges)
|
||||
|
||||
## Objectives
|
||||
|
||||
@@ -78,18 +78,18 @@ Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algor
|
||||
## Activity
|
||||
|
||||
* time: 20 min.
|
||||
* [tutorial](/microbit/lessons/blink/tutorial)
|
||||
* [quiz](/microbit/lessons/blink/quiz)
|
||||
* [quiz answers](/microbit/lessons/blink/quiz-answers)
|
||||
* [tutorial](/lessons/blink/tutorial)
|
||||
* [quiz](/lessons/blink/quiz)
|
||||
* [quiz answers](/lessons/blink/quiz-answers)
|
||||
|
||||
## Extended Activity
|
||||
|
||||
* time: 20 min.
|
||||
* [challenges](/microbit/lessons/blink/challenges)
|
||||
* [challenges](/lessons/blink/challenges)
|
||||
|
||||
## Homework
|
||||
|
||||
* Extended Activity: [challenges](/microbit/lessons/blink/challenges)
|
||||
* Extended Activity: [challenges](/lessons/blink/challenges)
|
||||
|
||||
## Intended follow on
|
||||
|
||||
|
@@ -49,7 +49,7 @@ basic.forever(() => {
|
||||
|
||||
### ~avatar boothing
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/microbit/lessons/blink/challenges)!
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/blink/challenges)!
|
||||
|
||||
### ~
|
||||
|
||||
|
@@ -4,7 +4,7 @@ Coding challenges for the blink tutorial.
|
||||
|
||||
## Before we get started
|
||||
|
||||
Complete the [blink](/microbit/lessons/blink/activity) activity and your code will look like this:
|
||||
Complete the [blink](/lessons/blink/activity) activity and your code will look like this:
|
||||
|
||||
```
|
||||
basic.forever(() => {
|
||||
|
@@ -10,10 +10,10 @@ Plot - Blinking LED
|
||||
|
||||
## Quick links
|
||||
|
||||
* [tutorial](/microbit/lessons/blink/tutorial)
|
||||
* [quiz](/microbit/js/blink/quiz)
|
||||
* [quiz answers](/microbit/lessons/blink/quiz-answers)
|
||||
* [challenges](/microbit/lessons/blink/challenges)
|
||||
* [tutorial](/lessons/blink/tutorial)
|
||||
* [quiz](/js/blink/quiz)
|
||||
* [quiz answers](/lessons/blink/quiz-answers)
|
||||
* [challenges](/lessons/blink/challenges)
|
||||
|
||||
## Class
|
||||
|
||||
@@ -37,16 +37,16 @@ Learn how to control a blinking LED. We will be learning how to create a blinkin
|
||||
|
||||
## Documentation
|
||||
|
||||
* **plot**: [read more...](/microbit/reference/led/plot)
|
||||
* **pause**: [read more...](/microbit/reference/basic/pause)
|
||||
* **clear screen**: [read more...](/microbit/reference/basic/clear-screen)
|
||||
* **forever**: [read more...](/microbit/reference/basic/forever)
|
||||
* **plot**: [read more...](/reference/led/plot)
|
||||
* **pause**: [read more...](/reference/basic/pause)
|
||||
* **clear screen**: [read more...](/reference/basic/clear-screen)
|
||||
* **forever**: [read more...](/reference/basic/forever)
|
||||
|
||||
## Resources
|
||||
|
||||
* Activity: [tutorial](/microbit/lessons/blink/tutorial)
|
||||
* Activity: [quiz](/microbit/lessons/blink/quiz)
|
||||
* Extended Activity: [challenges](/microbit/lessons/blink/challenges)
|
||||
* Activity: [tutorial](/lessons/blink/tutorial)
|
||||
* Activity: [quiz](/lessons/blink/quiz)
|
||||
* Extended Activity: [challenges](/lessons/blink/challenges)
|
||||
|
||||
## Objectives
|
||||
|
||||
@@ -81,19 +81,19 @@ Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algor
|
||||
## Activity
|
||||
|
||||
* time: 20 min.
|
||||
* [tutorial](/microbit/lessons/blink/tutorial)
|
||||
* [quiz](/microbit/lessons/blink/quiz)
|
||||
* [tutorial](/lessons/blink/tutorial)
|
||||
* [quiz](/lessons/blink/quiz)
|
||||
* assessment opportunities: forever, plot, pause, clear screen
|
||||
|
||||
## Extended Activity
|
||||
|
||||
* time: 20 min.
|
||||
* [challenges](/microbit/lessons/blink/challenges)
|
||||
* [challenges](/lessons/blink/challenges)
|
||||
* assessment opportunities: loops, plot, pause, clear screen
|
||||
|
||||
## Homework
|
||||
|
||||
* Extended Activity: [challenges](/microbit/lessons/blink/challenges)
|
||||
* Extended Activity: [challenges](/lessons/blink/challenges)
|
||||
|
||||
## Intended follow on
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
Learn how to create a blinking LED script.
|
||||
|
||||
This is the answer key for the [blink quiz](/microbit/lessons/blink/quiz).
|
||||
This is the answer key for the [blink quiz](/lessons/blink/quiz).
|
||||
|
||||
## 1. Describe what `led->plot` does?
|
||||
|
||||
|
@@ -6,7 +6,7 @@ Learn how to create a blinking LED script.
|
||||
|
||||
## Directions
|
||||
|
||||
Use this activity document to guide your work in the [blink tutorial](/microbit/lessons/blink/tutorial).
|
||||
Use this activity document to guide your work in the [blink tutorial](/lessons/blink/tutorial).
|
||||
|
||||
Answer the questions while completing the tutorial. Pay attention to the dialogues!
|
||||
|
||||
|
@@ -8,10 +8,10 @@ Game Library
|
||||
|
||||
## Quick Links
|
||||
|
||||
* [tutorial](/microbit/lessons/bop-it/tutorial)
|
||||
* [quiz](/microbit/lessons/bop-it/quiz)
|
||||
* [quiz answers](/microbit/lessons/bop-it/quiz-answers)
|
||||
* [challenges](/microbit/lessons/bop-it/challenges)
|
||||
* [tutorial](/lessons/bop-it/tutorial)
|
||||
* [quiz](/lessons/bop-it/quiz)
|
||||
* [quiz answers](/lessons/bop-it/quiz-answers)
|
||||
* [challenges](/lessons/bop-it/challenges)
|
||||
|
||||
## Class
|
||||
|
||||
@@ -23,18 +23,18 @@ Learn how to create a minesweeper game with **if**, `if condition do` , **global
|
||||
|
||||
## Documentation
|
||||
|
||||
* **game library** : [read more...](/microbit/js/game-library)
|
||||
* **global variables** : [read more...](/microbit/js/data)
|
||||
* **assignment operator** : [read more...](/microbit/reference/variables/assignment)
|
||||
* **functions** : [read more...](/microbit/js/function)
|
||||
* **call** : [read more...](/microbit/js/call)
|
||||
* **math random number** : [read more...](/microbit/js/math)
|
||||
* **on button pressed** : [read more...](/microbit/reference/input/on-button-pressed)
|
||||
* **on logo down** : [read more...](/microbit/functions/on-logo-down)
|
||||
* **on shake** : [read more...](/microbit/reference/input/on-gesture)
|
||||
* **if** : [read more...](/microbit/reference/logic/if)
|
||||
* **show number** : [read more...](/microbit/reference/basic/show-number)
|
||||
* **show string** : [read more...](/microbit/reference/basic/show-string)
|
||||
* **game library** : [read more...](/js/game-library)
|
||||
* **global variables** : [read more...](/js/data)
|
||||
* **assignment operator** : [read more...](/reference/variables/assignment)
|
||||
* **functions** : [read more...](/js/function)
|
||||
* **call** : [read more...](/js/call)
|
||||
* **math random number** : [read more...](/js/math)
|
||||
* **on button pressed** : [read more...](/reference/input/on-button-pressed)
|
||||
* **on logo down** : [read more...](/functions/on-logo-down)
|
||||
* **on shake** : [read more...](/reference/input/on-gesture)
|
||||
* **if** : [read more...](/reference/logic/if)
|
||||
* **show number** : [read more...](/reference/basic/show-number)
|
||||
* **show string** : [read more...](/reference/basic/show-string)
|
||||
|
||||
## Objectives
|
||||
|
||||
@@ -83,15 +83,15 @@ Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algor
|
||||
## Activity
|
||||
|
||||
* time: 20 min.
|
||||
* [tutorial](/microbit/lessons/bop-it/tutorial)
|
||||
* [quiz](/microbit/lessons/bop-it/quiz)
|
||||
* [tutorial](/lessons/bop-it/tutorial)
|
||||
* [quiz](/lessons/bop-it/quiz)
|
||||
|
||||
## Extended Activity
|
||||
|
||||
* time: 20 min.
|
||||
* [challenges](/microbit/lessons/bop-it/challenges)
|
||||
* [challenges](/lessons/bop-it/challenges)
|
||||
|
||||
## Homework
|
||||
|
||||
* Extended Activity: [challenges](/microbit/lessons/bop-it/challenges)
|
||||
* Extended Activity: [challenges](/lessons/bop-it/challenges)
|
||||
|
||||
|
@@ -10,10 +10,10 @@ Basic- Show Animation
|
||||
|
||||
## Quick Links
|
||||
|
||||
* [tutorial](/microbit/lessons/bounce-image/tutorial)
|
||||
* [quiz](/microbit/lessons/bounce-image/quiz)
|
||||
* [quiz answers](/microbit/lessons/bounce-image/quiz-answers)
|
||||
* [challenges](/microbit/lessons/bounce-image/challenges)
|
||||
* [tutorial](/lessons/bounce-image/tutorial)
|
||||
* [quiz](/lessons/bounce-image/quiz)
|
||||
* [quiz answers](/lessons/bounce-image/quiz-answers)
|
||||
* [challenges](/lessons/bounce-image/challenges)
|
||||
|
||||
## Class
|
||||
|
||||
@@ -39,15 +39,15 @@ Learn how to creating an **animation**, `basic->show animation` to display a ser
|
||||
|
||||
## Documentation
|
||||
|
||||
* **forever** : [read more...](/microbit/reference/basic/forever)
|
||||
* **show animation** : [read more...](/microbit/reference/basic/show-animation)
|
||||
* **on shake** : [read more...](/microbit/reference/input/on-gesture)
|
||||
* **forever** : [read more...](/reference/basic/forever)
|
||||
* **show animation** : [read more...](/reference/basic/show-animation)
|
||||
* **on shake** : [read more...](/reference/input/on-gesture)
|
||||
|
||||
## Resources
|
||||
|
||||
* Activity: [tutorial](/microbit/lessons/bounce-image/tutorial)
|
||||
* Activity: [quiz](/microbit/lessons/bounce-image/quiz)
|
||||
* Extended Activity: [challenges](/microbit/lessons/bounce-image/challenges)
|
||||
* Activity: [tutorial](/lessons/bounce-image/tutorial)
|
||||
* Activity: [quiz](/lessons/bounce-image/quiz)
|
||||
* Extended Activity: [challenges](/lessons/bounce-image/challenges)
|
||||
|
||||
## Objectives
|
||||
|
||||
@@ -90,17 +90,17 @@ Computational Thinking Concept: AB = Abstraction; DE = Decomposition; AL = Algor
|
||||
## Activity
|
||||
|
||||
* time: 20 min.
|
||||
* [tutorial](/microbit/lessons/bounce-image/tutorial)
|
||||
* [quiz](/microbit/lessons/bounce-image/quiz)
|
||||
* [tutorial](/lessons/bounce-image/tutorial)
|
||||
* [quiz](/lessons/bounce-image/quiz)
|
||||
|
||||
## Extended Activity
|
||||
|
||||
* time: 20 min.
|
||||
* [challenges](/microbit/lessons/bounce-image/challenges)
|
||||
* [challenges](/lessons/bounce-image/challenges)
|
||||
|
||||
## Homework
|
||||
|
||||
* Extended Activity: [challenges](/microbit/lessons/bounce-image/challenges)
|
||||
* Extended Activity: [challenges](/lessons/bounce-image/challenges)
|
||||
|
||||
## Intended follow on
|
||||
|
||||
|
@@ -6,7 +6,7 @@ Coding challenges for the bounce image tutorial. #docs
|
||||
|
||||
Complete the following guided tutorial:
|
||||
|
||||
* [tutorial](/microbit/lessons/bounce-image/tutorial)
|
||||
* [tutorial](/lessons/bounce-image/tutorial)
|
||||
|
||||
At the end of the tutorial, click `keep editing`. Your code should look like this:
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
scroll an image on the BBC micro:bit.
|
||||
|
||||
This is the answer key for the [bounce image quiz](/microbit/lessons/bounce-image/quiz).
|
||||
This is the answer key for the [bounce image quiz](/lessons/bounce-image/quiz).
|
||||
|
||||
## 1. What does it mean to 'add frames' ?
|
||||
|
||||
|
@@ -6,7 +6,7 @@ scroll an image on the BBC micro:bit.
|
||||
|
||||
## Directions
|
||||
|
||||
Use this document to guide your work in the [bounce image tutorial](/microbit/lessons/bounce-image/tutorial) !
|
||||
Use this document to guide your work in the [bounce image tutorial](/lessons/bounce-image/tutorial) !
|
||||
|
||||
Answer the questions while completing the tutorial. Pay attention to the dialogues!
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
My script. #docs
|
||||
|
||||
This [guided tutorial](/microbit/lessons/boxer-mania/tutorial) will help you create an animation!
|
||||
This [guided tutorial](/lessons/boxer-mania/tutorial) will help you create an animation!
|
||||
|
||||
**Challenge 0**
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user