diff --git a/docs/blocks/logic/boolean.md b/docs/blocks/logic/boolean.md index 478c2498..8a02291b 100644 --- a/docs/blocks/logic/boolean.md +++ b/docs/blocks/logic/boolean.md @@ -27,4 +27,4 @@ input.onButtonPressed(Button.A, () => { }) ``` -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. +See the documentation on [Numbers](/types/number) for more information on comparing two Numbers. diff --git a/docs/blocks/variables/assign.md b/docs/blocks/variables/assign.md index 11375c09..9efecc84 100644 --- a/docs/blocks/variables/assign.md +++ b/docs/blocks/variables/assign.md @@ -1,7 +1,7 @@ # Assignment Operator -Use an equals sign to make a [variable](/blocks/variables/var) store the [number](/reference/types/number) -or [string](/reference/types/string) you say. +Use an equals sign to make a [variable](/blocks/variables/var) store the [number](/types/number) +or [string](/types/string) you say. When you use the equals sign to store something in a variable, the equals sign is called an *assignment operator*, and what you store is called a *value*. @@ -27,10 +27,10 @@ basic.showString(name); ### Notes You can use the assignment operator with variables of -every [type](/reference/types). A *type* is which kind of thing +every [type](/types). A *type* is which kind of thing a variable can store, like a number or string. ### See also -[variable](/blocks/variables/var), [types](/reference/types) +[variable](/blocks/variables/var), [types](/types) diff --git a/docs/blocks/variables/var.md b/docs/blocks/variables/var.md index 443489b8..f428062b 100644 --- a/docs/blocks/variables/var.md +++ b/docs/blocks/variables/var.md @@ -4,7 +4,7 @@ How to define and use local variables. ### @parent language -A variable is a place where you can store and retrieve data. Variables have a name, a [type](/reference/types), and value: +A variable is a place where you can store and retrieve data. Variables have a name, a [type](/types), and value: * *name* is how you'll refer to the variable * *type* refers to the kind of data a variable can store @@ -83,5 +83,5 @@ if (led.brightness() > 128) { ### See also -[types](/reference/types), [assignment operator](/blocks/variables/assign) +[types](/types), [assignment operator](/blocks/variables/assign) diff --git a/docs/lessons/counter.md b/docs/lessons/counter.md index 3f557b40..93c52851 100644 --- a/docs/lessons/counter.md +++ b/docs/lessons/counter.md @@ -35,7 +35,7 @@ basic.showLeds(` ``` * **variable**: [read more...](/blocks/variables) -* **arithmetic operators**: [read more...](/reference/types/number) +* **arithmetic operators**: [read more...](/types/number) * **on button pressed** : [read more...](/reference/input/on-button-pressed) * **show number** : [read more...](/reference/basic/show-number) diff --git a/docs/reference.md b/docs/reference.md index 257425d3..f5450e1b 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -44,4 +44,4 @@ bluetooth ### See Also -[basic](/reference/basic), [input](/reference/input), [music](/reference/music), [led](/reference/led), [Math (blocks)](/blocks/math), [String](/reference/types/string), [game](/reference/game), [images](/reference/images), [pins](/reference/pins), [serial](/reference/serial), [control](/reference/control), [radio](/reference/radio), [devices](/reference/devices), [bluetooth](/reference/bluetooth) +[basic](/reference/basic), [input](/reference/input), [music](/reference/music), [led](/reference/led), [Math (blocks)](/blocks/math), [String](/types/string), [game](/reference/game), [images](/reference/images), [pins](/reference/pins), [serial](/reference/serial), [control](/reference/control), [radio](/reference/radio), [devices](/reference/devices), [bluetooth](/reference/bluetooth) diff --git a/docs/reference/basic/forever.md b/docs/reference/basic/forever.md index 8455c257..bb61bf08 100644 --- a/docs/reference/basic/forever.md +++ b/docs/reference/basic/forever.md @@ -33,7 +33,7 @@ basic.forever(() => { ### Example: counter -The following example keeps showing the [number](/reference/types/number) stored in a global variable. +The following example keeps showing the [number](/types/number) stored in a global variable. When you press button `A`, the number gets bigger. You can use a program like this to count things with your @boardname@. diff --git a/docs/reference/basic/show-animation.md b/docs/reference/basic/show-animation.md index 3259b049..0d0e74a4 100644 --- a/docs/reference/basic/show-animation.md +++ b/docs/reference/basic/show-animation.md @@ -14,8 +14,8 @@ basic.showAnimation(` ### Parameters -* `leds` is a [String](/reference/types/string) that shows which LEDs are on and off, in groups one after another. -* `interval` is an optional [Number](/reference/types/number). It means the number of milliseconds to pause after each image frame. +* `leds` is a [String](/types/string) that shows which LEDs are on and off, in groups one after another. +* `interval` is an optional [Number](/types/number). It means the number of milliseconds to pause after each image frame. ### Example: Animating a group of image frames diff --git a/docs/reference/basic/show-leds.md b/docs/reference/basic/show-leds.md index e8cb4b6b..71ef2ea3 100644 --- a/docs/reference/basic/show-leds.md +++ b/docs/reference/basic/show-leds.md @@ -15,8 +15,8 @@ basic.showLeds(` ### Parameters -* `leds` is a [string](/reference/types/string) that controls which LEDs are on and off. -* `interval` is an optional [number](/reference/types/number) that means how many milliseconds to wait after showing a picture. +* `leds` is a [string](/types/string) that controls which LEDs are on and off. +* `interval` is an optional [number](/types/number) that means how many milliseconds to wait after showing a picture. If you are programming with blocks, `interval` is set at 400 milliseconds. ### Example diff --git a/docs/reference/basic/show-number.md b/docs/reference/basic/show-number.md index 4e005aea..81fa985e 100644 --- a/docs/reference/basic/show-number.md +++ b/docs/reference/basic/show-number.md @@ -8,8 +8,8 @@ basic.showNumber(2) ### Parameters -* `value` is a [Number](/reference/types/number). -* `interval` is an optional [Number](/reference/types/number). It means the number of milliseconds before sliding the `value` left by one LED each time. Bigger intervals make the sliding slower. +* `value` is a [Number](/types/number). +* `interval` is an optional [Number](/types/number). It means the number of milliseconds before sliding the `value` left by one LED each time. Bigger intervals make the sliding slower. ### Examples: @@ -39,10 +39,10 @@ for (let i = 0; i < 6; i++) { ### Other show functions -* Use [show string](/reference/basic/show-string) to show a [String](/reference/types/string) with letters on the screen. +* Use [show string](/reference/basic/show-string) to show a [String](/types/string) with letters on the screen. * Use [show animation](/reference/basic/show-animation) to show a group of pictures on the screen, one after another. ### See also -[show string](/reference/basic/show-string), [show animation](/reference/basic/show-animation), [Number](/reference/types/number), [math](/blocks/math) +[show string](/reference/basic/show-string), [show animation](/reference/basic/show-animation), [Number](/types/number), [math](/blocks/math) diff --git a/docs/reference/basic/show-string.md b/docs/reference/basic/show-string.md index 930c9810..5fc4111e 100644 --- a/docs/reference/basic/show-string.md +++ b/docs/reference/basic/show-string.md @@ -8,8 +8,8 @@ basic.showString("Hello!") ### Parameters -* `text` is a [String](/reference/types/string). It can contain letters, numbers, and punctuation. -* `interval` is an optional [Number](/reference/types/number). It means the number of milliseconds before sliding the [String](/reference/types/string) left by one LED each time. Bigger intervals make the sliding slower. +* `text` is a [String](/types/string). It can contain letters, numbers, and punctuation. +* `interval` is an optional [Number](/types/number). It means the number of milliseconds before sliding the [String](/types/string) left by one LED each time. Bigger intervals make the sliding slower. ### Examples: @@ -19,7 +19,7 @@ To show the word **Hello**: basic.showString("Hello") ``` -To show what is stored in a [String](/reference/types/string) variable: +To show what is stored in a [String](/types/string) variable: ```blocks let s = "Hi" @@ -33,5 +33,5 @@ basic.showString(s) ### See also -[String](/reference/types/string), [show number](/reference/basic/show-number), [show animation](/reference/basic/show-animation) +[String](/types/string), [show number](/reference/basic/show-number), [show animation](/reference/basic/show-animation) diff --git a/docs/reference/bluetooth/advertise-uid-buffer.md b/docs/reference/bluetooth/advertise-uid-buffer.md index 062408df..61b0cbe7 100644 --- a/docs/reference/bluetooth/advertise-uid-buffer.md +++ b/docs/reference/bluetooth/advertise-uid-buffer.md @@ -24,7 +24,7 @@ bluetooth.advertiseUidBuffer(pins.createBuffer(16), 7, true); ### Parameters * ``buffer`` - a 16 bytes buffer containing the namespace (first 10 bytes) and instance (last 6 bytes). -* ``power`` - a [number](/reference/types/number) representing the power level between 0 (short) and 7 (maximum range). +* ``power`` - a [number](/types/number) representing the power level between 0 (short) and 7 (maximum range). * ``connectable`` - a [boolean](/blocks/logic/boolean) indicating whether or not the @boardname@ should accept connections. diff --git a/docs/reference/bluetooth/advertise-uid.md b/docs/reference/bluetooth/advertise-uid.md index 50d95f63..6b57f363 100644 --- a/docs/reference/bluetooth/advertise-uid.md +++ b/docs/reference/bluetooth/advertise-uid.md @@ -25,7 +25,7 @@ bluetooth.advertiseUid(42, 1, 7, true); * ``namespace`` last 4 bytes of the namespace uid (6 to 9) * ``instance`` last 4 bytes of the instance (2 to 5) -* ``power`` - a [number](/reference/types/number) representing the power level between 0 (short) and 7 (maximum range). +* ``power`` - a [number](/types/number) representing the power level between 0 (short) and 7 (maximum range). * ``connectable`` - a [boolean](/blocks/logic/boolean) indicating whether or not the @boardname@ should accept connections. ## Encoding diff --git a/docs/reference/bluetooth/advertise-url.md b/docs/reference/bluetooth/advertise-url.md index 0e2a0275..900d31a2 100644 --- a/docs/reference/bluetooth/advertise-url.md +++ b/docs/reference/bluetooth/advertise-url.md @@ -23,8 +23,8 @@ bluetooth.advertiseUrl("https://pxt.microbit.org/", 7, true); ### Parameters -* ``url`` - a [string](/reference/types/string) containing the URL to broadcast, at most 17 characters long, excluding the protocol (eg: ``https://``) which gets encoded as 1 byte. -* ``power`` - a [number](/reference/types/number) representing the power level between 0 (short) and 7 (maximum range). +* ``url`` - a [string](/types/string) containing the URL to broadcast, at most 17 characters long, excluding the protocol (eg: ``https://``) which gets encoded as 1 byte. +* ``power`` - a [number](/types/number) representing the power level between 0 (short) and 7 (maximum range). * ``connectable`` - a [boolean](/blocks/logic/boolean) indicating whether or not the @boardname@ should accept connections. ### Example: Broadcast a secret code diff --git a/docs/reference/bluetooth/set-transmit-power.md b/docs/reference/bluetooth/set-transmit-power.md index 6323f354..375a93c3 100644 --- a/docs/reference/bluetooth/set-transmit-power.md +++ b/docs/reference/bluetooth/set-transmit-power.md @@ -15,7 +15,7 @@ bluetooth.setTransmitPower(7); ### Parameters -* `power`: a [number](/reference/types/number) in the range ``0..7``, where ``0`` is the lowest power and ``7`` is the highest. +* `power`: a [number](/types/number) in the range ``0..7``, where ``0`` is the lowest power and ``7`` is the highest. ### See also diff --git a/docs/reference/game/change-score-by.md b/docs/reference/game/change-score-by.md index 6002d4d5..0db9044c 100644 --- a/docs/reference/game/change-score-by.md +++ b/docs/reference/game/change-score-by.md @@ -7,7 +7,7 @@ game.addScore(1) ``` ### Parameters -* a [number](/reference/types/number) that means how much to add to the score. A negative number means to subtract from the score. +* a [number](/types/number) that means how much to add to the score. A negative number means to subtract from the score. ### Examples diff --git a/docs/reference/game/change-sprite-property.md b/docs/reference/game/change-sprite-property.md index 4eb6d5fc..31a39506 100644 --- a/docs/reference/game/change-sprite-property.md +++ b/docs/reference/game/change-sprite-property.md @@ -1,6 +1,6 @@ # Get Sprite Property -Change the kind of [number](/reference/types/number) you say for a [sprite](/reference/game/create-sprite). +Change the kind of [number](/types/number) you say for a [sprite](/reference/game/create-sprite). ```sig let item: game.LedSprite = null; @@ -10,7 +10,7 @@ item.set(LedSpriteProperty.X, 0); ### Parameters * the **sprite** you want to change -* the kind of [number](/reference/types/number) you want to change for the sprite, like +* the kind of [number](/types/number) you want to change for the sprite, like * ``x``, how far up or down the sprite is on the screen (`0`-`4`) * ``y``, how far left or right the sprite is on the screen (`0`-`4`) * ``direction``, which way the sprite is pointing (this works the same way as the [turn](/reference/game/turn) function) diff --git a/docs/reference/game/get-sprite-property.md b/docs/reference/game/get-sprite-property.md index 35fcdcc6..d2eb870f 100644 --- a/docs/reference/game/get-sprite-property.md +++ b/docs/reference/game/get-sprite-property.md @@ -10,7 +10,7 @@ item.get(LedSpriteProperty.X); ### Parameters * the **sprite** you want to know something about -* the kind of [number](/reference/types/number) you want to know about the sprite, like +* the kind of [number](/types/number) you want to know about the sprite, like * ``x``, how far up or down the sprite is on the screen (`0`-`4`) * ``y``, how far left or right the sprite is on the screen (`0`-`4`) * ``direction``, which way the sprite is pointing (this works the same way as the [turn](/reference/game/turn) function) @@ -19,7 +19,7 @@ item.get(LedSpriteProperty.X); ### Returns -The [number](/reference/types/number) you asked for. +The [number](/types/number) you asked for. ### Example diff --git a/docs/reference/game/move.md b/docs/reference/game/move.md index 299070c0..883fa70c 100644 --- a/docs/reference/game/move.md +++ b/docs/reference/game/move.md @@ -9,7 +9,7 @@ item.move(1); ### Parameters -* a [number](/reference/types/number) that means how many LEDs the sprite should move +* a [number](/types/number) that means how many LEDs the sprite should move ### Example diff --git a/docs/reference/game/set-score.md b/docs/reference/game/set-score.md index fda88506..3be165f0 100644 --- a/docs/reference/game/set-score.md +++ b/docs/reference/game/set-score.md @@ -7,7 +7,7 @@ game.setScore(1) ``` ### Parameters -* a [number](/reference/types/number) that represents the new score. +* a [number](/types/number) that represents the new score. ### Examples diff --git a/docs/reference/game/set-sprite-property.md b/docs/reference/game/set-sprite-property.md index 60fbfbaf..1a05e556 100644 --- a/docs/reference/game/set-sprite-property.md +++ b/docs/reference/game/set-sprite-property.md @@ -1,6 +1,6 @@ # Set Sprite Property -Make a [sprite](/reference/game/create-sprite) store the kind of [number](/reference/types/number) you say. +Make a [sprite](/reference/game/create-sprite) store the kind of [number](/types/number) you say. ```sig let item: game.LedSprite = null; @@ -10,7 +10,7 @@ item.set(LedSpriteProperty.X, 0); ### Parameters * the **sprite** you want to make store the number you say -* the kind of [number](/reference/types/number) you want to store in the sprite, like +* the kind of [number](/types/number) you want to store in the sprite, like * ``x``, how far up or down the sprite is on the screen (`0`-`4`) * ``y``, how far left or right the sprite is on the screen (`0`-`4`) * ``direction``, which way the sprite is pointing (this works the same way as the [turn](/reference/game/turn) function) diff --git a/docs/reference/game/start-countdown.md b/docs/reference/game/start-countdown.md index 7d768194..2dba0fe1 100644 --- a/docs/reference/game/start-countdown.md +++ b/docs/reference/game/start-countdown.md @@ -8,7 +8,7 @@ game.startCountdown(1000) ### Parameters -* ``ms`` is a [number](/reference/types/number) that says how many milliseconds to count down (one second is 1000 milliseconds) +* ``ms`` is a [number](/types/number) that says how many milliseconds to count down (one second is 1000 milliseconds) ### Examples diff --git a/docs/reference/game/turn.md b/docs/reference/game/turn.md index 4d602431..54cc6f27 100644 --- a/docs/reference/game/turn.md +++ b/docs/reference/game/turn.md @@ -10,7 +10,7 @@ item.turn(Direction.Right, 45); ### Parameters * a choice whether the sprite should turn **left** or **right** -* a [number](/reference/types/number) that means how much the sprite should turn. +* a [number](/types/number) that means how much the sprite should turn. This number is in **degrees**, so a straight left or right turn is 90 degrees. ### Example diff --git a/docs/reference/images/create-big-image.md b/docs/reference/images/create-big-image.md index 1a5395c3..2dc1ea99 100644 --- a/docs/reference/images/create-big-image.md +++ b/docs/reference/images/create-big-image.md @@ -16,7 +16,7 @@ images.createBigImage(` ### Parameters -* ``leds`` is a [string](/reference/types/string) that says which LEDs +* ``leds`` is a [string](/types/string) that says which LEDs on the screen should be on and which should be off. diff --git a/docs/reference/images/create-image.md b/docs/reference/images/create-image.md index 935c6b66..739ae86a 100644 --- a/docs/reference/images/create-image.md +++ b/docs/reference/images/create-image.md @@ -15,7 +15,7 @@ images.createImage(` ### Parameters -* ``leds`` is a [string](/reference/types/string) that says which LEDs +* ``leds`` is a [string](/types/string) that says which LEDs on the screen should be on and which should be off. ### Example: Flip-flopping arrow diff --git a/docs/reference/images/pixel.md b/docs/reference/images/pixel.md index f11b8147..83a087a9 100644 --- a/docs/reference/images/pixel.md +++ b/docs/reference/images/pixel.md @@ -12,8 +12,8 @@ export function pixel(_this: micro_bit.Image, x: number, y: number) : boolean ### Parameters -* x - [Number](/reference/types/number); the *x coordinate* or horizontal position of a pixel in an [image](/reference/images/image) -* y - [Number](/reference/types/number); the *y coordinate* or vertical position of a pixel in an [image](/reference/images/image) +* x - [Number](/types/number); the *x coordinate* or horizontal position of a pixel in an [image](/reference/images/image) +* y - [Number](/types/number); the *y coordinate* or vertical position of a pixel in an [image](/reference/images/image) ### x, y coordinates? diff --git a/docs/reference/images/plot-frame.md b/docs/reference/images/plot-frame.md index b49ed1de..8aa4abb8 100644 --- a/docs/reference/images/plot-frame.md +++ b/docs/reference/images/plot-frame.md @@ -12,7 +12,7 @@ export function plotFrame(_this: micro_bit.Image, index: number) ### Parameters -* index - [Number](/reference/types/number); which frame of the image to display +* index - [Number](/types/number); which frame of the image to display ### Difference from `plot image` diff --git a/docs/reference/images/plot-image.md b/docs/reference/images/plot-image.md index b51daa76..ffdf231c 100644 --- a/docs/reference/images/plot-image.md +++ b/docs/reference/images/plot-image.md @@ -12,7 +12,7 @@ export function plotImage(_this: micro_bit.Image, xOffset: number) ### Parameters -* 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. +* x offset - [Number](/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` diff --git a/docs/reference/images/scroll-image.md b/docs/reference/images/scroll-image.md index 7b041286..4f451c56 100644 --- a/docs/reference/images/scroll-image.md +++ b/docs/reference/images/scroll-image.md @@ -10,7 +10,7 @@ item.scrollImage(5, 200); ### Parameters -* a [number](/reference/types/number) that means +* a [number](/types/number) that means how many LEDs to scroll at a time, from right to left or left to right. If you use a positive number like `2`, the image will scroll from the right side of the screen to the left. @@ -20,7 +20,7 @@ item.scrollImage(5, 200); image. It is a square with five LEDs on a side). This is useful for **animation**. -* a [number](/reference/types/number) that means +* a [number](/types/number) that means how many milliseconds to wait before scrolling the amount that ``offset`` says. (1000 milliseconds is one second.) The bigger you make this number, the slower the image will scroll. diff --git a/docs/reference/images/set-pixel.md b/docs/reference/images/set-pixel.md index 1be28eb5..bc618e85 100644 --- a/docs/reference/images/set-pixel.md +++ b/docs/reference/images/set-pixel.md @@ -12,8 +12,8 @@ export function setPixel(_this: micro_bit.Image, x: number, y: number, value: bo ### Parameters -* x - [Number](/reference/types/number); the *x coordinate* or horizontal position of a pixel in an [image](/reference/images/image) -* x - [Number](/reference/types/number); the *y coordinate* or vertical position of a pixel in an [image](/reference/images/image) +* x - [Number](/types/number); the *x coordinate* or horizontal position of a pixel in an [image](/reference/images/image) +* x - [Number](/types/number); the *y coordinate* or vertical position of a pixel in an [image](/reference/images/image) * value -[Boolean](/blocks/logic/boolean); the on/off state of a pixel; `true` for on, `false` for off ### x, y coordinates? diff --git a/docs/reference/images/show-frame.md b/docs/reference/images/show-frame.md index 18134bb4..8be61d61 100644 --- a/docs/reference/images/show-frame.md +++ b/docs/reference/images/show-frame.md @@ -12,7 +12,7 @@ export function showFrame(img: micro_bit.Image, frame: number) ### Parameters -* index - [Number](/reference/types/number); which frame of the image to display +* index - [Number](/types/number); which frame of the image to display ### Difference from `plot frame` diff --git a/docs/reference/images/show-image.md b/docs/reference/images/show-image.md index fe038d38..aab348f0 100644 --- a/docs/reference/images/show-image.md +++ b/docs/reference/images/show-image.md @@ -12,7 +12,7 @@ item.showImage(0); ### Parameters * an [image](/reference/images/image) (picture). It is usually a square with five LEDs on a side, but it might be wider. -* a [number](/reference/types/number) that says how many LEDs from the left of the picture the @boardname@ should start. `0` means start at the first **frame** of the picture, `5` means start at the second frame, `10` means start at the third, and so on. +* a [number](/types/number) that says how many LEDs from the left of the picture the @boardname@ should start. `0` means start at the first **frame** of the picture, `5` means start at the second frame, `10` means start at the third, and so on. ### Example: Flip-flopping arrow diff --git a/docs/reference/images/width.md b/docs/reference/images/width.md index 31df2f77..4a0bfcfa 100644 --- a/docs/reference/images/width.md +++ b/docs/reference/images/width.md @@ -14,7 +14,7 @@ images.createImage().width(); ### Returns -* [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). +* [Number](/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: diff --git a/docs/reference/input/acceleration.md b/docs/reference/input/acceleration.md index 67e55c83..2d58eb71 100644 --- a/docs/reference/input/acceleration.md +++ b/docs/reference/input/acceleration.md @@ -23,7 +23,7 @@ A **g** is as much acceleration as you get from Earth's gravity. ### Returns -* a [number](/reference/types/number) that means the amount of acceleration. When the @boardname@ is lying flat on a surface with the screen pointing up, `x` is `0`, `y` is `0`, and `z` is `-1023`. +* a [number](/types/number) that means the amount of acceleration. When the @boardname@ is lying flat on a surface with the screen pointing up, `x` is `0`, `y` is `0`, and `z` is `-1023`. ### Example: bar chart diff --git a/docs/reference/input/button-is-pressed.md b/docs/reference/input/button-is-pressed.md index 7cc7235e..f5a0c960 100644 --- a/docs/reference/input/button-is-pressed.md +++ b/docs/reference/input/button-is-pressed.md @@ -8,7 +8,7 @@ input.buttonIsPressed(Button.A); ### Parameters -* ``button`` is a [String](/reference/types/string). You should store `A` in it to check the left button, `B` to check the right button, or `A+B` to check both at the same time. +* ``button`` is a [String](/types/string). You should store `A` in it to check the left button, `B` to check the right button, or `A+B` to check both at the same time. ### Returns diff --git a/docs/reference/input/compass-heading.md b/docs/reference/input/compass-heading.md index 58fd4556..800191f0 100644 --- a/docs/reference/input/compass-heading.md +++ b/docs/reference/input/compass-heading.md @@ -12,7 +12,7 @@ input.compassHeading(); ### Returns -* a [number](/reference/types/number) from `0` to `360` degrees, which means the compass heading. If the compass isn't ready, it returns `-1003`. +* a [number](/types/number) from `0` to `360` degrees, which means the compass heading. If the compass isn't ready, it returns `-1003`. ### Example diff --git a/docs/reference/input/light-level.md b/docs/reference/input/light-level.md index 66d3f2a8..41bd44bf 100644 --- a/docs/reference/input/light-level.md +++ b/docs/reference/input/light-level.md @@ -16,7 +16,7 @@ input.lightLevel(); ### Returns -* a [Number](/reference/types/number) that means a light level from ``0`` (dark) to ``255`` (bright). +* a [Number](/types/number) that means a light level from ``0`` (dark) to ``255`` (bright). ### Example: show light level diff --git a/docs/reference/input/magnetic-force.md b/docs/reference/input/magnetic-force.md index 9b83c835..2e029cd7 100644 --- a/docs/reference/input/magnetic-force.md +++ b/docs/reference/input/magnetic-force.md @@ -22,7 +22,7 @@ The @boardname@ measures magnetic force with **microteslas**. ### Returns -* a [number](/reference/types/number) of microteslas that means the strength of the magnet +* a [number](/types/number) of microteslas that means the strength of the magnet ### Example: metal detector diff --git a/docs/reference/input/pin-is-pressed.md b/docs/reference/input/pin-is-pressed.md index f10e4537..df6fdc43 100644 --- a/docs/reference/input/pin-is-pressed.md +++ b/docs/reference/input/pin-is-pressed.md @@ -19,7 +19,7 @@ instead of the USB cable. ### Parameters -* a [string](/reference/types/string) that holds the pin name (**P0**, **P1**, or **P2**) +* a [string](/types/string) that holds the pin name (**P0**, **P1**, or **P2**) ### returns diff --git a/docs/reference/input/rotation.md b/docs/reference/input/rotation.md index 86d49c65..bda3b407 100644 --- a/docs/reference/input/rotation.md +++ b/docs/reference/input/rotation.md @@ -19,7 +19,7 @@ check how the @boardname@ is moving. ### Returns -* a [number](/reference/types/number) that means how much the microbit is tilted in the direction you say, from `0` to `360` degrees +* a [number](/types/number) that means how much the microbit is tilted in the direction you say, from `0` to `360` degrees ### Example: @boardname@ leveler diff --git a/docs/reference/input/running-time.md b/docs/reference/input/running-time.md index 974ee043..aa8e4d70 100644 --- a/docs/reference/input/running-time.md +++ b/docs/reference/input/running-time.md @@ -8,7 +8,7 @@ input.runningTime(); ### Returns -* the [Number](/reference/types/number) of milliseconds since the program started. +* the [Number](/types/number) of milliseconds since the program started. (One second is 1000 milliseconds.) ### Example: elapsed time diff --git a/docs/reference/input/temperature.md b/docs/reference/input/temperature.md index 75d7b2ec..14df5055 100644 --- a/docs/reference/input/temperature.md +++ b/docs/reference/input/temperature.md @@ -9,7 +9,7 @@ input.temperature(); ### Returns -* a [Number](/reference/types/number) that means the Celsius temperature. +* a [Number](/types/number) that means the Celsius temperature. ### How does it work? diff --git a/docs/reference/led/brightness.md b/docs/reference/led/brightness.md index 1772fead..6207de77 100644 --- a/docs/reference/led/brightness.md +++ b/docs/reference/led/brightness.md @@ -8,7 +8,7 @@ led.brightness(); ### Returns -* a [number](/reference/types/number) that means how bright the screen is when it is turned on, from `0` (darkest) to `255` (brightest). For example, the number `127` means the screen is halfway bright when it is turned on. +* a [number](/types/number) that means how bright the screen is when it is turned on, from `0` (darkest) to `255` (brightest). For example, the number `127` means the screen is halfway bright when it is turned on. ### Example: highest brightness diff --git a/docs/reference/led/enable.md b/docs/reference/led/enable.md index 861be1b3..4da69fc8 100644 --- a/docs/reference/led/enable.md +++ b/docs/reference/led/enable.md @@ -8,7 +8,7 @@ led.enable(false); ### Parameters -* ``on`` is a [boolean](/reference/types/boolean) that defines the on/off state of the screen +* ``on`` is a [boolean](/types/boolean) that defines the on/off state of the screen ### Example: Turning off the screen diff --git a/docs/reference/led/fade-in.md b/docs/reference/led/fade-in.md index b39a3f13..c2d22c60 100644 --- a/docs/reference/led/fade-in.md +++ b/docs/reference/led/fade-in.md @@ -8,7 +8,7 @@ led.fadeIn(700); ### Parameters -* ms - [Number](/reference/types/number); the speed by which the screen brightness is increased, expressed in milliseconds (1,000 milliseconds = 1 second). The smaller the number the faster the screen brightness increased. +* ms - [Number](/types/number); the speed by which the screen brightness is increased, expressed in milliseconds (1,000 milliseconds = 1 second). The smaller the number the faster the screen brightness increased. ### Example: fading dot diff --git a/docs/reference/led/fade-out.md b/docs/reference/led/fade-out.md index 43176868..8ca8f786 100644 --- a/docs/reference/led/fade-out.md +++ b/docs/reference/led/fade-out.md @@ -8,7 +8,7 @@ led.fadeOut(700); ### Parameters -* ms - [Number](/reference/types/number); the speed that the screen brightness is decreased, expressed in milliseconds (1,000 milliseconds = 1 second). The smaller the number the faster the screen brightness decreased. +* ms - [Number](/types/number); the speed that the screen brightness is decreased, expressed in milliseconds (1,000 milliseconds = 1 second). The smaller the number the faster the screen brightness decreased. ### Example: fade away letter A diff --git a/docs/reference/led/plot-bar-graph.md b/docs/reference/led/plot-bar-graph.md index 934394ef..66e24b89 100644 --- a/docs/reference/led/plot-bar-graph.md +++ b/docs/reference/led/plot-bar-graph.md @@ -9,11 +9,11 @@ led.plotBarGraph(2, 20); ### Parameters -* ``value`` is a [number](/reference/types/number) that means what you +* ``value`` is a [number](/types/number) that means what you are measuring or trying to show. For example, if you are measuring the temperature of ice with the @boardname@, ``value`` might be `0` because the temperature might be 0 degrees centigrade. -* ``high`` is a [number](/reference/types/number) that means the highest +* ``high`` is a [number](/types/number) that means the highest possible number that the ``value`` parameter can be. This number is also the tallest that the lines in the bar chart can be. diff --git a/docs/reference/led/plot.md b/docs/reference/led/plot.md index 0a200889..2f23b30c 100644 --- a/docs/reference/led/plot.md +++ b/docs/reference/led/plot.md @@ -14,10 +14,10 @@ Use [unplot](/reference/led/unplot) to turn **off** an LED. ### Parameters -* ``x`` is a [number](/reference/types/number) that means the +* ``x`` is a [number](/types/number) that means the horizontal spot on the LED screen (from left to right: 0, 1, 2, 3, or 4) -* ``y`` is a [number](/reference/types/number) that means the vertical +* ``y`` is a [number](/types/number) that means the vertical spot on the LED screen (from top to bottom: 0, 1, 2, 3, or 4) If a parameter is [out of bounds](/reference/out-of-bounds) (a value diff --git a/docs/reference/led/point.md b/docs/reference/led/point.md index 13f740ae..af85e0de 100644 --- a/docs/reference/led/point.md +++ b/docs/reference/led/point.md @@ -9,10 +9,10 @@ led.point(0,0); ### Parameters -* ``x`` is a [number](/reference/types/number) that means the +* ``x`` is a [number](/types/number) that means the horizontal spot on the LED screen (from left to right: 0, 1, 2, 3, or 4) -* ``y`` is a [number](/reference/types/number) that means the vertical +* ``y`` is a [number](/types/number) that means the vertical spot on the LED screen (from top to bottom: 0, 1, 2, 3, or 4) If a parameter is [out of bounds](/reference/out-of-bounds) (a value diff --git a/docs/reference/led/set-brightness.md b/docs/reference/led/set-brightness.md index fd6df280..2c15d2c8 100644 --- a/docs/reference/led/set-brightness.md +++ b/docs/reference/led/set-brightness.md @@ -9,7 +9,7 @@ led.setBrightness(121) ### Parameters -* ``value`` is a [number](/reference/types/number) that means how +* ``value`` is a [number](/types/number) that means how bright the screen is when it is turned on, from `0` (darkest) to `255` (brightest). For example, the number `127` means the screen is halfway bright when it is turned on. diff --git a/docs/reference/led/toggle.md b/docs/reference/led/toggle.md index 5cfa5b28..561d7ead 100644 --- a/docs/reference/led/toggle.md +++ b/docs/reference/led/toggle.md @@ -8,8 +8,8 @@ led.toggle(0,0) ### Parameters -* x - [Number](/reference/types/number); the *x coordinate* or horizontal position (0, 1, 2, 3, 4) -* y - [Number](/reference/types/number); the *y coordinate* or vertical position (0, 1, 2, 3, 4) +* x - [Number](/types/number); the *x coordinate* or horizontal position (0, 1, 2, 3, 4) +* y - [Number](/types/number); the *y coordinate* or vertical position (0, 1, 2, 3, 4) If a parameter is [out of bounds](/reference/out-of-bounds) (a value other than 0-4), then this function will do nothing. diff --git a/docs/reference/led/unplot.md b/docs/reference/led/unplot.md index 0cbb9ad1..de979d31 100644 --- a/docs/reference/led/unplot.md +++ b/docs/reference/led/unplot.md @@ -14,10 +14,10 @@ Use [plot](/reference/led/plot) to turn **on** an LED. ### Parameters -* ``x`` is a [number](/reference/types/number) that means the +* ``x`` is a [number](/types/number) that means the horizontal spot on the LED screen (from left to right: 0, 1, 2, 3, or 4) -* ``y`` is a [number](/reference/types/number) that means the vertical +* ``y`` is a [number](/types/number) that means the vertical spot on the LED screen (from top to bottom: 0, 1, 2, 3, or 4) If a parameter is [out of bounds](/reference/out-of-bounds) (a value diff --git a/docs/reference/music/beat.md b/docs/reference/music/beat.md index 5c62f689..fb9fe4f3 100644 --- a/docs/reference/music/beat.md +++ b/docs/reference/music/beat.md @@ -16,7 +16,7 @@ music.beat(BeatFraction.Whole) ### Returns -* a [number](/reference/types/number) that means the amount of milli-seconds a beat fraction represents. +* a [number](/types/number) that means the amount of milli-seconds a beat fraction represents. ## Example diff --git a/docs/reference/music/change-tempo-by.md b/docs/reference/music/change-tempo-by.md index 8f66b4c7..64ebb786 100644 --- a/docs/reference/music/change-tempo-by.md +++ b/docs/reference/music/change-tempo-by.md @@ -13,7 +13,7 @@ music.changeTempoBy(20) ### Parameters -* ``bpm`` is a [number](/reference/types/number) that says how much to +* ``bpm`` is a [number](/types/number) that says how much to change the bpm (beats per minute, or number of beats in a minute of the music that the @boardname@ is playing). diff --git a/docs/reference/music/play-tone.md b/docs/reference/music/play-tone.md index f13108ec..8ca38a4c 100644 --- a/docs/reference/music/play-tone.md +++ b/docs/reference/music/play-tone.md @@ -12,8 +12,8 @@ music.playTone(440, 120) ### Parameters -* ``frequency`` is the [number](/reference/types/number) of Hertz (how high or low the tone is). -* ``ms`` is the [number](/reference/types/number) of milliseconds that the tone lasts +* ``frequency`` is the [number](/types/number) of Hertz (how high or low the tone is). +* ``ms`` is the [number](/types/number) of milliseconds that the tone lasts ## Example diff --git a/docs/reference/music/rest.md b/docs/reference/music/rest.md index 10909ad4..5b447e34 100644 --- a/docs/reference/music/rest.md +++ b/docs/reference/music/rest.md @@ -12,7 +12,7 @@ music.rest(400) ### Parameters -* ``ms`` is a [number](/reference/types/number) saying how many +* ``ms`` is a [number](/types/number) saying how many milliseconds the @boardname@ should rest. One second is 1000 milliseconds. diff --git a/docs/reference/music/ring-tone.md b/docs/reference/music/ring-tone.md index 0ff51f8e..bc21c6fa 100644 --- a/docs/reference/music/ring-tone.md +++ b/docs/reference/music/ring-tone.md @@ -13,7 +13,7 @@ music.ringTone(440) ### Parameters -* ``frequency`` is a [number](/reference/types/number) that says +* ``frequency`` is a [number](/types/number) that says how high-pitched or low-pitched the tone is. This number is in **Hz** (**Hertz**), which is a measurement of frequency or pitch. diff --git a/docs/reference/music/set-tempo.md b/docs/reference/music/set-tempo.md index 83f5c477..3941b4eb 100644 --- a/docs/reference/music/set-tempo.md +++ b/docs/reference/music/set-tempo.md @@ -11,7 +11,7 @@ This function only works on the @boardname@ and in some browsers. ### Parameters -* ``bpm`` is a [number](/reference/types/number) that means the beats per minute you want (the number of beats in a minute of the music that the @boardname@ is playing). +* ``bpm`` is a [number](/types/number) that means the beats per minute you want (the number of beats in a minute of the music that the @boardname@ is playing). ### See also diff --git a/docs/reference/music/tempo.md b/docs/reference/music/tempo.md index 9fe81623..58dadc33 100644 --- a/docs/reference/music/tempo.md +++ b/docs/reference/music/tempo.md @@ -8,7 +8,7 @@ music.tempo() ### Returns -* a [number](/reference/types/number) that means the beats per minute (number of +* a [number](/types/number) that means the beats per minute (number of beats in a minute of the music that the @boardname@ is playing). ### See also diff --git a/docs/reference/pins/analog-pitch.md b/docs/reference/pins/analog-pitch.md index 193bc0a0..1889aa3e 100644 --- a/docs/reference/pins/analog-pitch.md +++ b/docs/reference/pins/analog-pitch.md @@ -9,8 +9,8 @@ pins.analogPitch(440, 300) ### Parameters -* `frequency` : [Number](/reference/types/number) -* `ms`: [Number](/reference/types/number) +* `frequency` : [Number](/types/number) +* `ms`: [Number](/types/number) ### Example diff --git a/docs/reference/pins/analog-read-pin.md b/docs/reference/pins/analog-read-pin.md index f8e1211f..12642c1c 100644 --- a/docs/reference/pins/analog-read-pin.md +++ b/docs/reference/pins/analog-read-pin.md @@ -9,12 +9,12 @@ pins.analogReadPin(AnalogPin.P0) ### Parameters -* ``name`` is a [string](/reference/types/string) with the name of the pin +* ``name`` is a [string](/types/string) with the name of the pin you say (`P0` through `P4`, or `P10`) ### Returns -* a [number](/reference/types/number) from `0` through `1023` +* a [number](/types/number) from `0` through `1023` This program reads pin `P1` and shows the number on the LED screen. diff --git a/docs/reference/pins/analog-set-period.md b/docs/reference/pins/analog-set-period.md index 0624c7a2..c934f32a 100644 --- a/docs/reference/pins/analog-set-period.md +++ b/docs/reference/pins/analog-set-period.md @@ -10,8 +10,8 @@ pins.analogSetPeriod(AnalogPin.P0, 20000) ### Parameters -* ``name``: a [string](/reference/types/string) that specifies the pin to configure (`P0` through `P4`, or `P10`) -* ``micros``: a [number](/reference/types/number) that specifies the analog period in microseconds. +* ``name``: a [string](/types/string) that specifies the pin to configure (`P0` through `P4`, or `P10`) +* ``micros``: a [number](/types/number) that specifies the analog period in microseconds. The following code first sets `P0` to analog with **analog write pin**, and then sets the PWM period of `P0` to 20,000 microseconds. diff --git a/docs/reference/pins/analog-set-pitch-pin.md b/docs/reference/pins/analog-set-pitch-pin.md index 0aeac3f9..cb46200d 100644 --- a/docs/reference/pins/analog-set-pitch-pin.md +++ b/docs/reference/pins/analog-set-pitch-pin.md @@ -8,7 +8,7 @@ pins.analogSetPitchPin(AnalogPin.P0) ### Parameters -* `name` - [String](/reference/types/string); the pin name ("P0", "P1", or "P2") +* `name` - [String](/types/string); the pin name ("P0", "P1", or "P2") ### Example diff --git a/docs/reference/pins/analog-write-pin.md b/docs/reference/pins/analog-write-pin.md index c7fdca9a..1b78977f 100644 --- a/docs/reference/pins/analog-write-pin.md +++ b/docs/reference/pins/analog-write-pin.md @@ -9,8 +9,8 @@ pins.analogWritePin(AnalogPin.P0, 400) ### Parameters -* ``name`` is a [string](/reference/types/string) that is the pin name you say (`P0` through `P4`, or `P10`) -* ``value`` is a [number](/reference/types/number) from `0` through `1023` +* ``name`` is a [string](/types/string) that is the pin name you say (`P0` through `P4`, or `P10`) +* ``value`` is a [number](/types/number) from `0` through `1023` ### Example diff --git a/docs/reference/pins/digital-read-pin.md b/docs/reference/pins/digital-read-pin.md index 78acaad3..4c9f9e88 100644 --- a/docs/reference/pins/digital-read-pin.md +++ b/docs/reference/pins/digital-read-pin.md @@ -16,11 +16,11 @@ Please read the [page about pins](/device/pins) carefully. ### Parameters -* ``name`` is a [string](/reference/types/string) that stores the name of the pin (``P0``, ``P1``, or ``P2``, up through ``P20``) +* ``name`` is a [string](/types/string) that stores the name of the pin (``P0``, ``P1``, or ``P2``, up through ``P20``) ### Returns -* a [number](/reference/types/number) that can be `0` or `1` +* a [number](/types/number) that can be `0` or `1` ### Example: football score keeper diff --git a/docs/reference/pins/digital-write-pin.md b/docs/reference/pins/digital-write-pin.md index 5abe4a0b..096a555b 100644 --- a/docs/reference/pins/digital-write-pin.md +++ b/docs/reference/pins/digital-write-pin.md @@ -16,8 +16,8 @@ Please read the [page about pins](/device/pins) carefully. ### Parameters -* ``name`` is a [string](/reference/types/string) that stores the name of the pin (``P0``, ``P1``, or ``P2``, up through ``P20``) -* ``value`` is a [number](/reference/types/number) that can be either `0` or `1` +* ``name`` is a [string](/types/string) that stores the name of the pin (``P0``, ``P1``, or ``P2``, up through ``P20``) +* ``value`` is a [number](/types/number) that can be either `0` or `1` ### Example: football score keeper diff --git a/docs/reference/pins/map.md b/docs/reference/pins/map.md index d2b22cf2..be79127b 100644 --- a/docs/reference/pins/map.md +++ b/docs/reference/pins/map.md @@ -16,11 +16,11 @@ pins.map(0, 0, 4, 0, 1023); ### Parameters -* ``value``: a [number](/reference/types/number) that specifies the value to map -* ``fromLow``: a [number](/reference/types/number) that specifies the lower bound of the origin interval -* ``fromHigh``: a [number](/reference/types/number) that specifies the upper bound of the origin interval -* ``toLow``: a [number](/reference/types/number) that specifies the lower bound of the target interval -* ``toHigh``: a [number](/reference/types/number) that specifies the upper bound of the target interval +* ``value``: a [number](/types/number) that specifies the value to map +* ``fromLow``: a [number](/types/number) that specifies the lower bound of the origin interval +* ``fromHigh``: a [number](/types/number) that specifies the upper bound of the origin interval +* ``toLow``: a [number](/types/number) that specifies the lower bound of the target interval +* ``toHigh``: a [number](/types/number) that specifies the upper bound of the target interval ## Example diff --git a/docs/reference/pins/pulse-in.md b/docs/reference/pins/pulse-in.md index 3aa09fd2..f7cffa2d 100644 --- a/docs/reference/pins/pulse-in.md +++ b/docs/reference/pins/pulse-in.md @@ -16,13 +16,13 @@ Please read the [page about pins](/device/pins) carefully. ### Parameters -* ``name`` is a [string](/reference/types/string) that stores the name of the pin (``P0``, ``P1``, or ``P2``, up through ``P20``) +* ``name`` is a [string](/types/string) that stores the name of the pin (``P0``, ``P1``, or ``P2``, up through ``P20``) * ``value`` is the value of the pulse, ``high`` or ``low`` * ``maxDuration``, maximum duration in micro-seconds. If no pulse is received ### Returns -* a [number](/reference/types/number) that represents the pulse duration in micro-seconds +* a [number](/types/number) that represents the pulse duration in micro-seconds ### Example: Measuring distance with a sonar diff --git a/docs/reference/pins/servo-set-pulse.md b/docs/reference/pins/servo-set-pulse.md index 0bf38e10..1fa83890 100644 --- a/docs/reference/pins/servo-set-pulse.md +++ b/docs/reference/pins/servo-set-pulse.md @@ -9,8 +9,8 @@ pins.servoSetPulse(AnalogPin.P1, 1500) ### Parameters -* ``name``: a [string](/reference/types/string) that specifies the pin to configure (`P0` through `P4`, or `P10`) -* ``micros``: a [number](/reference/types/number) that specifies the analog period in microseconds. +* ``name``: a [string](/types/string) that specifies the pin to configure (`P0` through `P4`, or `P10`) +* ``micros``: a [number](/types/number) that specifies the analog period in microseconds. ### Example diff --git a/docs/reference/pins/servo-write-pin.md b/docs/reference/pins/servo-write-pin.md index db2ccb41..97b8674d 100644 --- a/docs/reference/pins/servo-write-pin.md +++ b/docs/reference/pins/servo-write-pin.md @@ -14,8 +14,8 @@ pins.servoWritePin(AnalogPin.P0, 180) ### Parameters -* ``name``: a [string](/reference/types/string) that specifies the pin name (`P0` through `P4`, or `P10`) -* ``value``: a [number](/reference/types/number) from `0` through `180` +* ``name``: a [string](/types/string) that specifies the pin name (`P0` through `P4`, or `P10`) +* ``value``: a [number](/types/number) from `0` through `180` ### Examples diff --git a/docs/reference/pins/spi-write.md b/docs/reference/pins/spi-write.md index ffee6be7..5e0ab570 100644 --- a/docs/reference/pins/spi-write.md +++ b/docs/reference/pins/spi-write.md @@ -12,7 +12,7 @@ pins.spiWrite(0); ### Returns -* a [number](/reference/types/number) Response from the SPI slave +* a [number](/types/number) Response from the SPI slave ### See also diff --git a/docs/reference/radio/on-data-packet-received.md b/docs/reference/radio/on-data-packet-received.md index 2afa15a5..2fd88763 100644 --- a/docs/reference/radio/on-data-packet-received.md +++ b/docs/reference/radio/on-data-packet-received.md @@ -1,7 +1,7 @@ # On Data Packet Received Run part of a program when the @boardname@ receives a -[number](/reference/types/number) or [string](/reference/types/string) over ``radio``. +[number](/types/number) or [string](/types/string) over ``radio``. ```sig @@ -17,8 +17,8 @@ To add or remove the parts of the packet from the block, try clicking the blue g ### Callback Parameters * ``packet`` - the [packet](/reference/radio/packet) that was received by the radio. The packet has the following properties: - * `receivedNumber` - The [number](/reference/types/number) that was sent in this packet or `0` if this packet did not contain a number. See [send number](/reference/radio/send-number) and [send value](/reference/radio/send-value) - * `receivedString` - The [string](/reference/types/string) that was sent in this packet or the empty string if this packet did not contain a string. See [send string](/reference/radio/send-string) and [send value](/reference/radio/send-value) + * `receivedNumber` - The [number](/types/number) that was sent in this packet or `0` if this packet did not contain a number. See [send number](/reference/radio/send-number) and [send value](/reference/radio/send-value) + * `receivedString` - The [string](/types/string) that was sent in this packet or the empty string if this packet did not contain a string. See [send string](/reference/radio/send-string) and [send value](/reference/radio/send-value) * `time` - The system time of the @boardname@ that sent this packet at the time the packet was sent. * `serial` - The serial number of the @boardname@ that sent this packet or `0` if the @boardname@ did not include its serial number. * `signal` - How strong the radio signal is from `-128` (weak) to `-42` (strong). diff --git a/docs/reference/radio/on-data-received.md b/docs/reference/radio/on-data-received.md index 19a2fa4f..b1ab8b8b 100644 --- a/docs/reference/radio/on-data-received.md +++ b/docs/reference/radio/on-data-received.md @@ -3,7 +3,7 @@ > Note: This API has been deprecated! Use [on data packet received](/reference/radio/on-data-packet-received) instead. Run part of a program when the @boardname@ receives a -[number](/reference/types/number) or [string](/reference/types/string) over ``radio``. +[number](/types/number) or [string](/types/string) over ``radio``. ```sig diff --git a/docs/reference/radio/packet.md b/docs/reference/radio/packet.md index d8dfc990..066b9c67 100644 --- a/docs/reference/radio/packet.md +++ b/docs/reference/radio/packet.md @@ -4,8 +4,8 @@ A packet that was received by the radio. ## Properties -* `receivedNumber` - The [number](/reference/types/number) that was sent in this packet or `0` if this packet did not contain a number. See [send number](/reference/radio/send-number) and [send value](/reference/radio/send-value) -* `receivedString` - The [string](/reference/types/string) that was sent in this packet or the empty string if this packet did not contain a string. See [send string](/reference/radio/send-string) and [send value](/reference/radio/send-value) +* `receivedNumber` - The [number](/types/number) that was sent in this packet or `0` if this packet did not contain a number. See [send number](/reference/radio/send-number) and [send value](/reference/radio/send-value) +* `receivedString` - The [string](/types/string) that was sent in this packet or the empty string if this packet did not contain a string. See [send string](/reference/radio/send-string) and [send value](/reference/radio/send-value) * `time` - The system time of the @boardname@ that sent this packet at the time the packet was sent. * `serial` - The serial number of the @boardname@ that sent this packet or `0` if the @boardname@ did not include its serial number. * `signal` - How strong the radio signal is from `255` (weak) to `0` (strong). diff --git a/docs/reference/radio/receive-number.md b/docs/reference/radio/receive-number.md index d8ce45d3..fe5c0f58 100644 --- a/docs/reference/radio/receive-number.md +++ b/docs/reference/radio/receive-number.md @@ -10,7 +10,7 @@ radio.receiveNumber(); ### Returns -* the first [number](/reference/types/number) that the @boardname@ received. If it did not receive any numbers, this function will return `0`. +* the first [number](/types/number) that the @boardname@ received. If it did not receive any numbers, this function will return `0`. ### Example: Simple number receiver diff --git a/docs/reference/radio/receive-string.md b/docs/reference/radio/receive-string.md index e5bcf8f5..e4a095db 100644 --- a/docs/reference/radio/receive-string.md +++ b/docs/reference/radio/receive-string.md @@ -10,7 +10,7 @@ radio.receiveString() ### Returns -* the first [string](/reference/types/string) that was sent. If no +* the first [string](/types/string) that was sent. If no string was sent, then this function returns an empty (blank) string. ### Example: Simple receiver diff --git a/docs/reference/radio/received-signal-strength.md b/docs/reference/radio/received-signal-strength.md index 1886efb8..90e985a8 100644 --- a/docs/reference/radio/received-signal-strength.md +++ b/docs/reference/radio/received-signal-strength.md @@ -16,7 +16,7 @@ radio.receivedSignalStrength(); ### Returns -* a [number](/reference/types/number) between `-128` and `-42` that means +* a [number](/types/number) between `-128` and `-42` that means how strong the signal is. ### Simulator diff --git a/docs/reference/radio/send-number.md b/docs/reference/radio/send-number.md index 5c655cf4..56197dde 100644 --- a/docs/reference/radio/send-number.md +++ b/docs/reference/radio/send-number.md @@ -1,6 +1,6 @@ # Send Number -Broadcast a [number](/reference/types/number) to other @boardname@s connected via ``radio``. +Broadcast a [number](/types/number) to other @boardname@s connected via ``radio``. ```sig radio.sendNumber(0); @@ -8,7 +8,7 @@ radio.sendNumber(0); ### Parameters -* ``value`` - a [number](/reference/types/number) to send. +* ``value`` - a [number](/types/number) to send. ### Example: Broadcasting acceleration diff --git a/docs/reference/radio/send-string.md b/docs/reference/radio/send-string.md index 53aa08a4..6fbda52f 100644 --- a/docs/reference/radio/send-string.md +++ b/docs/reference/radio/send-string.md @@ -9,7 +9,7 @@ radio.sendString("Hello!") ### Parameters -* `msg` is a [string](/reference/types/string) to send by radio. +* `msg` is a [string](/types/string) to send by radio. ### Example: Two-way radio diff --git a/docs/reference/radio/send-value.md b/docs/reference/radio/send-value.md index 5d991c93..c48223fc 100644 --- a/docs/reference/radio/send-value.md +++ b/docs/reference/radio/send-value.md @@ -9,8 +9,8 @@ radio.sendValue("name", 0); ### Parameters -* ``name`` is a [string](/reference/types/string) to send by radio -* ``value`` a [number](/reference/types/number) to send by radio +* ``name`` is a [string](/types/string) to send by radio +* ``value`` a [number](/types/number) to send by radio ### Example: Broadcasting acceleration diff --git a/docs/reference/radio/set-group.md b/docs/reference/radio/set-group.md index 02fd8c68..ee3cd1f3 100644 --- a/docs/reference/radio/set-group.md +++ b/docs/reference/radio/set-group.md @@ -16,7 +16,7 @@ radio.setGroup(0); ### Parameters -* ``id`` is a [number](/reference/types/number) from ``0`` to ``255``. +* ``id`` is a [number](/types/number) from ``0`` to ``255``. ### Simulator diff --git a/docs/reference/radio/set-transmit-power.md b/docs/reference/radio/set-transmit-power.md index 6f68a528..98ea1750 100644 --- a/docs/reference/radio/set-transmit-power.md +++ b/docs/reference/radio/set-transmit-power.md @@ -20,7 +20,7 @@ can reach as far as 70 meters (about 230 feet). ### Parameters -* ``power`` is a [number](/reference/types/number) between ``0`` and ``7`` that +* ``power`` is a [number](/types/number) between ``0`` and ``7`` that means how strong the signal is. ### Simulator diff --git a/docs/reference/radio/set-transmit-serial-number.md b/docs/reference/radio/set-transmit-serial-number.md index bb8f3880..391e2760 100644 --- a/docs/reference/radio/set-transmit-serial-number.md +++ b/docs/reference/radio/set-transmit-serial-number.md @@ -8,7 +8,7 @@ radio.setTransmitSerialNumber(true); ### Parameters -* ``transmit`` is a [boolean](/reference/types/boolean) that represents whether the serial number needs to be transmitted. +* ``transmit`` is a [boolean](/types/boolean) that represents whether the serial number needs to be transmitted. ### Example diff --git a/docs/reference/serial/on-data-received.md b/docs/reference/serial/on-data-received.md index de2a6888..e2b78e3a 100644 --- a/docs/reference/serial/on-data-received.md +++ b/docs/reference/serial/on-data-received.md @@ -9,7 +9,7 @@ serial.onDataReceived(",", () => {}) ### Parameters -* `delimiters` is a [string](/reference/types/string) containing any of the character to match +* `delimiters` is a [string](/types/string) containing any of the character to match ### Example diff --git a/docs/reference/serial/read-line.md b/docs/reference/serial/read-line.md index eb38402b..bea16df2 100644 --- a/docs/reference/serial/read-line.md +++ b/docs/reference/serial/read-line.md @@ -16,7 +16,7 @@ character. If your terminal software does not terminate lines with ### Returns -* a [string](/reference/types/string) containing input from the serial port, such as a response typed by a user +* a [string](/types/string) containing input from the serial port, such as a response typed by a user ### Example diff --git a/docs/reference/serial/read-string.md b/docs/reference/serial/read-string.md index 5f3861f5..b28f7593 100644 --- a/docs/reference/serial/read-string.md +++ b/docs/reference/serial/read-string.md @@ -8,7 +8,7 @@ serial.readString(); ### Returns -* a [string](/reference/types/string) containing input from the serial port. Empty if no data available. +* a [string](/types/string) containing input from the serial port. Empty if no data available. ### Example diff --git a/docs/reference/serial/read-until.md b/docs/reference/serial/read-until.md index 4303b30b..f4c4a1ef 100644 --- a/docs/reference/serial/read-until.md +++ b/docs/reference/serial/read-until.md @@ -8,7 +8,7 @@ serial.readUntil(","); ### Returns -* a [string](/reference/types/string) containing input from the serial port, such as a response typed by a user +* a [string](/types/string) containing input from the serial port, such as a response typed by a user ### Example diff --git a/docs/reference/serial/write-line.md b/docs/reference/serial/write-line.md index c9b3171d..b25c7e82 100644 --- a/docs/reference/serial/write-line.md +++ b/docs/reference/serial/write-line.md @@ -9,7 +9,7 @@ serial.writeLine(""); ### Parameters -* `text` is the [string](/reference/types/string) to write to the serial port +* `text` is the [string](/types/string) to write to the serial port ### Example: simple serial diff --git a/docs/reference/serial/write-number.md b/docs/reference/serial/write-number.md index 7e29cfbc..27830e4e 100644 --- a/docs/reference/serial/write-number.md +++ b/docs/reference/serial/write-number.md @@ -8,7 +8,7 @@ serial.writeNumber(0); ### Parameters -* `value` is the [number](/reference/types/number) to write to the serial port +* `value` is the [number](/types/number) to write to the serial port ### Example: one through ten diff --git a/docs/reference/serial/write-string.md b/docs/reference/serial/write-string.md index 4c673ff4..5fdd7b57 100644 --- a/docs/reference/serial/write-string.md +++ b/docs/reference/serial/write-string.md @@ -9,7 +9,7 @@ serial.writeString(""); ### Parameters -* `text` is the [string](/reference/types/string) to write to the serial port +* `text` is the [string](/types/string) to write to the serial port ### Example: simple serial diff --git a/docs/reference/serial/write-value.md b/docs/reference/serial/write-value.md index f19b706a..160f7e94 100644 --- a/docs/reference/serial/write-value.md +++ b/docs/reference/serial/write-value.md @@ -8,8 +8,8 @@ serial.writeValue("x", 0); ### Parameters -* `name` is the [string](/reference/types/string) to write to the serial port -* `value` is the [number](/reference/types/number) to write to the serial port +* `name` is the [string](/types/string) to write to the serial port +* `value` is the [number](/types/number) to write to the serial port diff --git a/docs/reference/types.md b/docs/reference/types.md deleted file mode 100644 index ab6fbcbf..00000000 --- a/docs/reference/types.md +++ /dev/null @@ -1,11 +0,0 @@ -# types - -A *type* refers to a class of data and the operations permitted on that class of data. -The following built-in types are supported for the @boardname@: - -* **[String](/reference/types/string)**: a sequence of characters -* **[Number](/reference/types/number)**: an integer number (32-bit signed) -* **[Boolean](/blocks/logic/boolean)**: true or false -* **[Image](/reference/images/image)**: a collection of [@boardname@ LED states](/device/screen) (on/off) - -TypeScript allows you to create user-defined classes of data. diff --git a/docs/reference/types/boolean.md b/docs/reference/types/boolean.md deleted file mode 100644 index b538ddc9..00000000 --- a/docs/reference/types/boolean.md +++ /dev/null @@ -1,16 +0,0 @@ -# Boolean - -true or false. - -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. - -The following blocks represent the true and false Boolean values, which can be plugged in anywhere a Boolean value is expected: - -```blocks -true; -false; -``` - -### See Also - -[boolean (blocks)](/blocks/logic/boolean) diff --git a/docs/reference/types/number.md b/docs/reference/types/number.md deleted file mode 100644 index ecddb249..00000000 --- a/docs/reference/types/number.md +++ /dev/null @@ -1,71 +0,0 @@ -# Number - -An integer number. - -### @parent blocks/language - -A *Number* is an integer such as `42` or `-42`. More precisely, a *Number* is a signed 32-bit integer (two's complement). - -### Declare a number variable - -You can assign a number to a variable: - -```blocks -let num = 42; -basic.showNumber(42); -``` - -### Arithmetic operators - -The following arithmetic operators work on numbers and return a [Number](/reference/types/number): - -* addition: `1 + 3` -* subtraction: `1 - 3 ` -* multiplication: `3 * 2` -* integer division: `7 / 3` -* modulo is available through the [math library](/blocks/math) - -### Relational operators - -The following relational operators work on numbers and return a [Boolean](/blocks/logic/boolean): - -* equality: `(3 + 1) = 4` -* inequality: `3 != 4` -* less or equal than: `3 <= 4` -* less than: `3 < 4` -* greater or equal than : `4 >= 3` -* greater than: `4 > 3` - -### Show number - -The [show number](/reference/basic/show-number) function displays a number on the [LED screen](/device/screen). -For example, this code displays the number 42: - -```blocks -basic.showNumber(42); -``` - -### Functions that return a number - -Some functions return a number, which you can store in a variable. -For example the following code gets the display brightness -(using the [brightness function](/reference/led/brightness)) and stores the value in a variable named `brightness`: - -```blocks -let brightness = led.brightness() -``` - -### Math functions - -The [math library](/blocks/math) includes math related functions. -For example, the `absolute` function returns the returns the absolute value of input parameter `x`: - -```blocks -let abs = Math.abs(-42); -basic.showNumber(abs); -``` - -### See also - -[math](/blocks/math), [var](/blocks/variables/var), [Boolean](/blocks/logic/boolean), [show number](/reference/basic/show-number) - diff --git a/docs/reference/types/string-functions.md b/docs/reference/types/string-functions.md deleted file mode 100644 index f546ce1c..00000000 --- a/docs/reference/types/string-functions.md +++ /dev/null @@ -1,3 +0,0 @@ -# String functions - -TBD \ No newline at end of file diff --git a/docs/reference/types/string.md b/docs/reference/types/string.md deleted file mode 100644 index a9d7ca9a..00000000 --- a/docs/reference/types/string.md +++ /dev/null @@ -1,45 +0,0 @@ -# String - -a piece of text. - -### @parent blocks/language - -A *String* is a sequence of characters. For the @boardname@, ASCII character codes 32 to 126 are supported; letters, digits, punctuation marks, and a few symbols. All other character codes appear as a ? on the [LED screen](/device/screen). - -### Create a string variable - -```block -let salutation = "Hello"; -``` - -To create a variable that holds a string: - -1. Click `Variables` (in the Block drawer). - -2. Type a name for your new string variable by clicking the down arrow, then click New Variable. Then type the variable name "salutation" - -2. Drag a string block on the right side of the operator. - -3. Click `"Hello"` and then type a string like `hello`. - -Your code should look something like this: - -```block -let salutation = "Hello"; -``` - -### The function `show string` - -Use [show string](/reference/basic/show-string) to display a string on the [LED screen](/device/screen). -If the string is multiple characters, the string scrolls right to left. The following example displays `Hello world!` on the @boardname@ screen: - -```block -basic.showString("Hello world!"); -``` - -The parameter of `show string` specifies the string - -### See also - -[string functions](/reference/types/string-functions), [Number](/reference/types/number), [show string](/reference/basic/show-string) - diff --git a/docs/types/string.md b/docs/types/string.md new file mode 100644 index 00000000..14fbbcfe --- /dev/null +++ b/docs/types/string.md @@ -0,0 +1,9 @@ +# @extends + +## #intro + +### ~ hint + +For the @boardname@, ASCII character codes 32 to 126 are supported; letters, digits, punctuation marks, and a few symbols. All other character codes appear as a ? on the [LED screen](/device/screen). + +### ~ \ No newline at end of file diff --git a/olddocs/js/bits.md b/olddocs/js/bits.md index 693ac82b..93901625 100644 --- a/olddocs/js/bits.md +++ b/olddocs/js/bits.md @@ -12,12 +12,12 @@ The Bits library includes functions for bit-level manipulation of integers. In t #### Syntax -bits `->` *and/or/xor* uint32 (x : [Number](/reference/types/number), y : [Number](/reference/types/number)) *returns* [Number](/reference/types/number) +bits `->` *and/or/xor* uint32 (x : [Number](/types/number), y : [Number](/types/number)) *returns* [Number](/types/number) #### Parameters -* x - an unsigned 32 bit integer [Number](/reference/types/number) -* y - another unsigned 32 bit integer [Number](/reference/types/number) +* x - an unsigned 32 bit integer [Number](/types/number) +* y - another unsigned 32 bit integer [Number](/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](/reference/types/number), bits : [Number](/reference/types/number)) *returns* [Number](/reference/types/number) +bits `->` rotate left unint32 (x : [Number](/types/number), bits : [Number](/types/number)) *returns* [Number](/types/number) -bits `->` rotate right unint32 (x : [Number](/reference/types/number), bits : [Number](/reference/types/number)) *returns* [Number](/reference/types/number) +bits `->` rotate right unint32 (x : [Number](/types/number), bits : [Number](/types/number)) *returns* [Number](/types/number) #### Parameters -* x - [Number](/reference/types/number); -* bits - [Number](/reference/types/number); +* x - [Number](/types/number); +* bits - [Number](/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](/reference/types/number), bits : [Number](/reference/types/number)) *returns* [Number](/reference/types/number) +bits `->` shift left unint32 (x : [Number](/types/number), bits : [Number](/types/number)) *returns* [Number](/types/number) -bits `->` shift right unint32 (x : [Number](/reference/types/number), bits : [Number](/reference/types/number)) *returns* [Number](/reference/types/number) +bits `->` shift right unint32 (x : [Number](/types/number), bits : [Number](/types/number)) *returns* [Number](/types/number) #### Parameters -* x - [Number](/reference/types/number); -* bits - [Number](/reference/types/number); +* x - [Number](/types/number); +* bits - [Number](/types/number); ### See also -[statements and operators](/javascript/statements), [math functions](/javascript/math), [Number](/reference/types/number) +[statements and operators](/javascript/statements), [math functions](/javascript/math), [Number](/types/number) diff --git a/olddocs/js/call.md b/olddocs/js/call.md index 20a4a603..821f600d 100644 --- a/olddocs/js/call.md +++ b/olddocs/js/call.md @@ -19,7 +19,7 @@ Type a function name in your code to call an existing [function](/javascript/fun ### Example: the square function -Here's a function called `square`, with a [Number](/reference/types/number) input parameter: +Here's a function called `square`, with a [Number](/types/number) input parameter: ``` /** diff --git a/olddocs/js/contents.md b/olddocs/js/contents.md index f26cd013..bf5bb2fd 100644 --- a/olddocs/js/contents.md +++ b/olddocs/js/contents.md @@ -31,9 +31,9 @@ Welcome to the Touch Develop home page for the @boardname@. Below you will find ### Types -* [Number](/reference/types/number) -* [Boolean](/reference/types/boolean) -* [String](/reference/types/string) +* [Number](/types/number) +* [Boolean](/types/boolean) +* [String](/types/string) * [Image](/reference/images/image) ### Statements and control structures @@ -50,19 +50,19 @@ Welcome to the Touch Develop home page for the @boardname@. Below you will find ### Maths -* arithmetic operators (`+`, `-`, `*`, `/`, mod) on [Numbers](/reference/types/number) -* comparison operators (such as `>`, `=`) on [Numbers](/reference/types/number) +* arithmetic operators (`+`, `-`, `*`, `/`, mod) on [Numbers](/types/number) +* comparison operators (such as `>`, `=`) on [Numbers](/types/number) * the [math](/js/math) library * the [bits](/js/bits) library ### Logical -* [Boolean](/reference/types/boolean) values `true` and `false` -* Operations (`not`, `or`, `and`) on [Booleans](/reference/types/boolean) +* [Boolean](/types/boolean) values `true` and `false` +* Operations (`not`, `or`, `and`) on [Booleans](/types/boolean) ### Strings -* [string functions](/reference/types/string-functions) +* [string functions](/types/string-functions) ### Functions diff --git a/olddocs/js/function.md b/olddocs/js/function.md index ea22740b..cc6f7204 100644 --- a/olddocs/js/function.md +++ b/olddocs/js/function.md @@ -61,8 +61,8 @@ export function square(x: number) : number { In the above code... -* ``x `` is the [input parameter](/js/functionparameters) ([Number](/reference/types/number) type) -* ``result`` is the [output parameter](/js/functionparameters) ([Number](/reference/types/number) type) +* ``x `` is the [input parameter](/js/functionparameters) ([Number](/types/number) type) +* ``result`` is the [output parameter](/js/functionparameters) ([Number](/types/number) type) * `return x * x` is the function body (which returns the value of the expression `x * x`) ### Add function parameters diff --git a/olddocs/js/functionparameters.md b/olddocs/js/functionparameters.md index 20ea12bd..d500a328 100644 --- a/olddocs/js/functionparameters.md +++ b/olddocs/js/functionparameters.md @@ -25,18 +25,18 @@ export function doStuff() { #### Input parameters -The default type for an input parameter is [Number](/reference/types/number): +The default type for an input parameter is [Number](/types/number): ``` export function oneInput(p: number) { } ``` -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. +To change the default type, click the type ([Number](/types/number) in this case) and change it to [String](/types/string), [Boolean](/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](/reference/types/number): +the default type for an output parameter is [Number](/types/number): ``` export function output() : number { @@ -46,7 +46,7 @@ export function output() : number { } ``` -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). +To change the default type, click the type ([Number](/types/number) in this case) and change it to [String](/types/string), [Boolean](/types/boolean), or [Image](/reference/image/image). ### Inputs and output function diff --git a/olddocs/js/guides/touchdevelop-lessons.md b/olddocs/js/guides/touchdevelop-lessons.md index e3bba877..2f3a0dbc 100644 --- a/olddocs/js/guides/touchdevelop-lessons.md +++ b/olddocs/js/guides/touchdevelop-lessons.md @@ -35,7 +35,7 @@ Overview of TouchDevelop lessons for the @boardname@. * [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) +* data types: [number](/types/number), [boolean](/types/boolean), [string](/types/string), [image](/reference/image/image) ### Statements and control structures @@ -52,18 +52,18 @@ Overview of TouchDevelop lessons for the @boardname@. ### Maths -* arithmetic operators (`+`, `-`, `*`, `/`, mod) on [numbers](/reference/types/number) -* comparison operators (such as `>`, `=`) on [numbers](/reference/types/number) +* arithmetic operators (`+`, `-`, `*`, `/`, mod) on [numbers](/types/number) +* comparison operators (such as `>`, `=`) on [numbers](/types/number) * the [math](/js/math) library * the [bits](/js/bits) library ### Logical -* boolean operators (`not`, `or`, `and`) on [booleans](/reference/types/boolean) +* boolean operators (`not`, `or`, `and`) on [booleans](/types/boolean) ### Strings -* concat operator combines [strings](/reference/types/string) +* concat operator combines [strings](/types/string) ### ~ diff --git a/olddocs/js/if.md b/olddocs/js/if.md index 218695ba..4a3ffd0b 100644 --- a/olddocs/js/if.md +++ b/olddocs/js/if.md @@ -5,7 +5,7 @@ Run code based on a condition. ### @parent javascript/language -Conditionally run code depending on whether a [Boolean](/reference/types/boolean) condition is true or false. +Conditionally run code depending on whether a [Boolean](/types/boolean) condition is true or false. ### Block Editor @@ -95,5 +95,5 @@ You can move an entire ``if`` block by clicking the ``if`` keyword and dragging ### See also -[while loop](/js/while), [for](/reference/loops/for), [boolean](/reference/types/boolean) +[while loop](/js/while), [for](/reference/loops/for), [boolean](/types/boolean) diff --git a/olddocs/js/lessons/jailbreak.md b/olddocs/js/lessons/jailbreak.md index 58040f0c..ae600afd 100644 --- a/olddocs/js/lessons/jailbreak.md +++ b/olddocs/js/lessons/jailbreak.md @@ -24,7 +24,7 @@ Learn how to create a **break**, `break` to exit a while or for loop before the ## Documentation * **Global Variable** : [read more...](/js/data) -* **Boolean** : [read more...](/reference/types/boolean) +* **Boolean** : [read more...](/types/boolean) * **On Button Pressed** : [read more...](/reference/input/on-button-pressed) * **While Loop** : [read more...](/js/while) * **Break** : [read more...](/js/break) diff --git a/olddocs/js/lessons/letter-up.md b/olddocs/js/lessons/letter-up.md index b3baa480..cae1cf47 100644 --- a/olddocs/js/lessons/letter-up.md +++ b/olddocs/js/lessons/letter-up.md @@ -38,8 +38,8 @@ Learn how to create a guessing game with **global variables** `var str: "this is ## Documentation -* **string** : [read more...](/reference/types/string) -* **string functions** : [read more...](/reference/types/string-functions) +* **string** : [read more...](/types/string) +* **string functions** : [read more...](/types/string-functions) * **show string** : [read more...](/reference/basic/show-string) * **local variables** : [read more...](/reference/variables/var) * **assignment operator** : [read more...](/reference/variables/assign) diff --git a/olddocs/js/lessons/line-of-fire.md b/olddocs/js/lessons/line-of-fire.md index 374478f8..efd0636c 100644 --- a/olddocs/js/lessons/line-of-fire.md +++ b/olddocs/js/lessons/line-of-fire.md @@ -26,8 +26,8 @@ Learn how to create **functions**, `function()` that perform a specific task and * **return** : [read more...](/js/return) * **call** : [read more...](/js/call) * **global variable** : [read more...](/js/data) -* **arithmetic operator** : [read more...](/reference/types/number) -* **Boolean** : [read more...](/reference/types/boolean) +* **arithmetic operator** : [read more...](/types/number) +* **Boolean** : [read more...](/types/boolean) * **forever** : [read more...](/reference/basic/forever) * **on button pressed** : [read more...](/reference/input/on-button-pressed) * **if** : [read more...](/reference/logic/if) diff --git a/olddocs/js/lessons/meteorite.md b/olddocs/js/lessons/meteorite.md index 41d66616..8b2b97e1 100644 --- a/olddocs/js/lessons/meteorite.md +++ b/olddocs/js/lessons/meteorite.md @@ -25,7 +25,7 @@ Learn how to create **functions**, `function()` that perform a specific task and * **function** : [read more...](/js/function) * **call** : [read more...](/js/call) * **global variable** : [read more...](/js/data) -* **arithmetic operators** : [read more...](/reference/types/number) +* **arithmetic operators** : [read more...](/types/number) * **math random** : [read more...](/js/math) * **forever** : [read more...](/reference/basic/forever) * **for** : [read more...](/reference/loops/for) diff --git a/olddocs/js/lessons/pong.md b/olddocs/js/lessons/pong.md index c201d36e..1ac3df35 100644 --- a/olddocs/js/lessons/pong.md +++ b/olddocs/js/lessons/pong.md @@ -44,7 +44,7 @@ Learn how to create **functions**, `function()` that perform a specific task and * **return** : [read more...](/js/return) * **call** : [read more...](/js/call) * **global variable** : [read more...](/js/data) -* **arithmetic operator** : [read more...](/reference/types/number) +* **arithmetic operator** : [read more...](/types/number) * **Boolean** : [/td/Boolean]() * **forever** : [read more...](/reference/basic/forever) * **on button pressed** : [read more...](/reference/input/on-button-pressed) diff --git a/olddocs/js/math.md b/olddocs/js/math.md index 4a28fe44..c43f9cfc 100644 --- a/olddocs/js/math.md +++ b/olddocs/js/math.md @@ -4,7 +4,7 @@ Functions in the math library. ### @parent javascript/language -The math library includes math related functions that you can use with [Numbers](/reference/types/number). +The math library includes math related functions that you can use with [Numbers](/types/number). * In the [TouchDevelop editor](/js/editor), click `math` to access the functions described below * In the [Block editor](/blocks/editor), click **maths** on the left to see the available blocks @@ -13,7 +13,7 @@ The functions available in Touch Develop are: ### abs -math `->` abs (x : [Number](/reference/types/number)) *returns* [Number](/reference/types/number) +math `->` abs (x : [Number](/types/number)) *returns* [Number](/types/number) returns the absolute value of input parameter `x` @@ -23,7 +23,7 @@ basic.showNumber(math.abs(-7), 150) ### clamp -math `->` clamp (min : [Number](/reference/types/number), max : [Number](/reference/types/number), value : [Number](/reference/types/number)) *returns* [Number](/reference/types/number) +math `->` clamp (min : [Number](/types/number), max : [Number](/types/number), value : [Number](/types/number)) *returns* [Number](/types/number) limits a number to a range (between a min and max number); returns `min` if `value` is < `min`; returns `max` if `value` is > `max`; otherwise, returns `value`. @@ -33,7 +33,7 @@ basic.showNumber(td.clamp(5, 9, 12), 150) ### max -math `->` max (x : [Number](/reference/types/number), y : [Number](/reference/types/number)) *returns* [Number](/reference/types/number) +math `->` max (x : [Number](/types/number), y : [Number](/types/number)) *returns* [Number](/types/number) returns the larger of two input numbers (`x` and `y`) @@ -43,7 +43,7 @@ basic.showNumber(Math.max(9, 7), 150) ### min -math `->` min (x : [Number](/reference/types/number), y : [Number](/reference/types/number)) *returns* [Number](/reference/types/number) +math `->` min (x : [Number](/types/number), y : [Number](/types/number)) *returns* [Number](/types/number) returns the smaller of two input numbers (`x` and `y`) @@ -53,7 +53,7 @@ basic.showNumber(Math.min(9, 7), 150) ### mod -math `->` mod (x : [Number](/reference/types/number), y : [Number](/reference/types/number)) *returns* [Number](/reference/types/number) +math `->` mod (x : [Number](/types/number), y : [Number](/types/number)) *returns* [Number](/types/number) returns the integer modulus/remainder resulting from the division of the number `x` by the number `y` @@ -63,7 +63,7 @@ basic.showNumber(math.mod(9, 7), 150) ### pow -math `->` pow (base : [Number](/reference/types/number), exp : [Number](/reference/types/number)) *returns* [Number](/reference/types/number) +math `->` pow (base : [Number](/types/number), exp : [Number](/types/number)) *returns* [Number](/types/number) returns the value of the number `base` raised to the power `exp` @@ -73,9 +73,9 @@ basic.showNumber(math.pow(3, 3), 150) ### random -math `->` random (limit : [Number](/reference/types/number)) *returns* [Number](/reference/types/number) +math `->` random (limit : [Number](/types/number)) *returns* [Number](/types/number) -returns a random [Number](/reference/types/number) between 0 and the parameter *limit* - 1 +returns a random [Number](/types/number) between 0 and the parameter *limit* - 1 ``` basic.showNumber(Math.random(10), 150) @@ -83,7 +83,7 @@ basic.showNumber(Math.random(10), 150) ### sign -math `->` sign (x : [Number](/reference/types/number)) *returns* [Number](/reference/types/number) +math `->` sign (x : [Number](/types/number)) *returns* [Number](/types/number) returns the sign of input parameter `x` @@ -97,5 +97,5 @@ basic.showNumber(math.sign(-7), 150) ### See also -[Bits library](/js/bits), [TouchDevelop documentation](/js/contents), [Number](/reference/types/number) +[Bits library](/js/bits), [TouchDevelop documentation](/js/contents), [Number](/types/number) diff --git a/olddocs/js/number.md b/olddocs/js/number.md index 4f057a86..2acb3205 100644 --- a/olddocs/js/number.md +++ b/olddocs/js/number.md @@ -19,7 +19,7 @@ To declare a *global* number variable, see [global variables](/js/data). ### Arithmetic operators -The following arithmetic operators work on numbers and return a [Number](/reference/types/number): +The following arithmetic operators work on numbers and return a [Number](/types/number): * addition: `1 + 3` * subtraction: `1 - 3 ` @@ -29,7 +29,7 @@ The following arithmetic operators work on numbers and return a [Number](/refere ### Relational operators -The following relational operators work on numbers and return a [Boolean](/reference/types/boolean): +The following relational operators work on numbers and return a [Boolean](/types/boolean): * equality: `(3 + 1) = 4` * inequality: `3 != 4` @@ -64,7 +64,7 @@ number1 = math.mod(4, 3) ### Convert a number to a string -The `to string` function converts a Number into a [String](/reference/types/string). The following code converts `number1` to a string and stores the string in the `str` variable: +The `to string` function converts a Number into a [String](/types/string). The following code converts `number1` to a string and stores the string in the `str` variable: ``` let str = number1.toString() @@ -80,5 +80,5 @@ The [bits library](/js/bits) includes functions for bit-level manipulation of in ### See also -[math library](/js/math), [var](/reference/variables/var), [bits library](/js/bits), [Boolean](/reference/types/boolean), [show number](/reference/basic/show-number) +[math library](/js/math), [var](/reference/variables/var), [bits library](/js/bits), [Boolean](/types/boolean), [show number](/reference/basic/show-number) diff --git a/olddocs/js/statements.md b/olddocs/js/statements.md index 79210ff5..cad30e4a 100644 --- a/olddocs/js/statements.md +++ b/olddocs/js/statements.md @@ -23,10 +23,10 @@ TouchDevelop statements include: TouchDevelop operators include: * [assignment operator](/reference/variables/assign) `:=` (to update variables) -* arithmetic operators (`+`, `-`, `*`, `/`, mod) operate on [Numbers](/reference/types/number) -* comparison operators (such as `>`, `=`) operate on [Numbers](/reference/types/number) -* boolean operators (`not`, `or`, `and`) operate on [Booleans](/reference/types/boolean) -* concat operator combines [Strings](/reference/types/string) +* arithmetic operators (`+`, `-`, `*`, `/`, mod) operate on [Numbers](/types/number) +* comparison operators (such as `>`, `=`) operate on [Numbers](/types/number) +* boolean operators (`not`, `or`, `and`) operate on [Booleans](/types/boolean) +* concat operator combines [Strings](/types/string) ### Libraries diff --git a/olddocs/js/string-functions.md b/olddocs/js/string-functions.md index 333a25a8..6691aeca 100644 --- a/olddocs/js/string-functions.md +++ b/olddocs/js/string-functions.md @@ -34,11 +34,11 @@ find out if two strings are the same #### Syntax -[String](/reference/types/string) `->` **equals** (other : [String](/reference/types/string)) *returns* [Boolean](/reference/types/boolean) +[String](/types/string) `->` **equals** (other : [String](/types/string)) *returns* [Boolean](/types/boolean) #### Parameters -* other - [String](/reference/types/string); a string +* other - [String](/types/string); a string #### Example @@ -56,11 +56,11 @@ get a character within a string, using the specified index #### Syntax -[String](/reference/types/string) `->` **at** (index: [Number](/reference/types/number)) *returns* [String](/reference/types/string) +[String](/types/string) `->` **at** (index: [Number](/types/number)) *returns* [String](/types/string) #### Parameters -* index- [Number](/reference/types/number); the character number within a string (0 returns the first character) +* index- [Number](/types/number); the character number within a string (0 returns the first character) #### Example @@ -87,11 +87,11 @@ combine two strings; like the concat operator (`||`) #### Syntax -[String](/reference/types/string) `->` **concat** (other : [String](/reference/types/string)) *returns* [String](/reference/types/string) +[String](/types/string) `->` **concat** (other : [String](/types/string)) *returns* [String](/types/string) #### Parameters -* other- [String](/reference/types/string); a string +* other- [String](/types/string); a string #### Example @@ -109,7 +109,7 @@ get the number of characters in a string #### Syntax -[String](/reference/types/string) `->` **count** *returns* [Number](/reference/types/number) +[String](/types/string) `->` **count** *returns* [Number](/types/number) #### Example @@ -125,12 +125,12 @@ get a portion of a string, using a starting point and length #### Syntax -[String](/reference/types/string) `->` **substring** (start : [Number](/reference/types/number), length : [Number](/reference/types/number)) *returns* [String](/reference/types/string) +[String](/types/string) `->` **substring** (start : [Number](/types/number), length : [Number](/types/number)) *returns* [String](/types/string) #### Parameters -* start - [Number](/reference/types/number); the starting character number (0 is the first character number in a string) -* length - [Number](/reference/types/number); the string length +* start - [Number](/types/number); the starting character number (0 is the first character number in a string) +* length - [Number](/types/number); the string length #### Example @@ -146,7 +146,7 @@ converts the first character of a string into a character code number (unicode) #### Syntax -[String](/reference/types/string) `->` **to character code** *returns* [Number](/reference/types/number) +[String](/types/string) `->` **to character code** *returns* [Number](/types/number) #### Example @@ -162,7 +162,7 @@ converts a string into a number #### Syntax -[String](/reference/types/string) `->` **to number** *returns* [Number](/reference/types/number) +[String](/types/string) `->` **to number** *returns* [Number](/types/number) #### Example @@ -174,5 +174,5 @@ x = parseFloat(str) ### See also -[string](/reference/types/string), [number](/reference/types/number), [show string](/reference/basic/show-string) +[string](/types/string), [number](/types/number), [show string](/reference/basic/show-string) diff --git a/olddocs/js/string.md b/olddocs/js/string.md index 9f2b225b..f13bd4a6 100644 --- a/olddocs/js/string.md +++ b/olddocs/js/string.md @@ -44,7 +44,7 @@ The first parameter of `show string` specifies the string, and the second parame ### More string functions -Want to compare or concatenate strings? Check out the [string functions](/reference/types/string-functions). +Want to compare or concatenate strings? Check out the [string functions](/types/string-functions). ### Global string variables @@ -56,5 +56,5 @@ Unlike [local variables](/reference/variables/var), global variables are accessi ### See also -[local variables](/reference/variables/var), [global variables](/js/data), [string functions](/reference/types/string-functions), [Number](/reference/types/number), [show string](/reference/basic/show-string) +[local variables](/reference/variables/var), [global variables](/js/data), [string functions](/types/string-functions), [Number](/types/number), [show string](/reference/basic/show-string) diff --git a/olddocs/js/types.md b/olddocs/js/types.md index 29adebda..43dde520 100644 --- a/olddocs/js/types.md +++ b/olddocs/js/types.md @@ -7,9 +7,9 @@ Touch Develop types. A *type* refers to a class of data and the operations permitted on that data. The following types are supported by Touch Develop for the @boardname@: -* **[String](/reference/types/string)**: a sequence of characters -* **[Number](/reference/types/number)**: an integer number (32-bit signed) -* **[Boolean](/reference/types/boolean)**: true or false +* **[String](/types/string)**: a sequence of characters +* **[Number](/types/number)**: an integer number (32-bit signed) +* **[Boolean](/types/boolean)**: true or false * **[Image](/reference/image/image)**: a collection of [@boardname@ LED states](/device/screen) (on/off) * *more types coming!!!* diff --git a/olddocs/js/var.md b/olddocs/js/var.md index 4fe22280..b2cd46c7 100644 --- a/olddocs/js/var.md +++ b/olddocs/js/var.md @@ -104,5 +104,5 @@ Use **global variables** when you need to access a variable in nested code block ### See also -[types](/reference/types), [assignment operator](/reference/variables/assign) +[types](/types), [assignment operator](/reference/variables/assign) diff --git a/olddocs/js/while.md b/olddocs/js/while.md index 2f44d9e4..0c8750ed 100644 --- a/olddocs/js/while.md +++ b/olddocs/js/while.md @@ -5,7 +5,7 @@ Repeat code in a loop while a condition is true. ### @parent javascript/language -Repeat code while a [Boolean](/reference/types/boolean) `condition` is true. +Repeat code while a [Boolean](/types/boolean) `condition` is true. ### ~hide @@ -26,7 +26,7 @@ while (condition) { } ``` -The while loop has a *condition* that evaluates to a [Boolean](/reference/types/boolean) value. After the `do` keyword, add the code that you want to run while the `condition` is `true`. The while loop concludes with `end while`. +The while loop has a *condition* that evaluates to a [Boolean](/types/boolean) value. After the `do` keyword, add the code that you want to run while the `condition` is `true`. The while loop concludes with `end while`. The condition is tested before any code runs. Which means that if the condition is false, the code inside the loop doesn't execute. Use the [break statement](/js/break) to exit a while loop before it's complete.