pxt-microbit Accessibility PR (#529)

* Accessibility changes
This commit is contained in:
Sam El-Husseini
2017-09-07 13:42:08 -07:00
committed by GitHub
parent 3f87576a50
commit e3975e65e5
357 changed files with 1641 additions and 3540 deletions

View File

@ -2,7 +2,7 @@
## #examples
### Example: ``AND`` operator
## Example: ``AND`` operator
This example turns on LED `3 , 3`, if LEDs `1 , 1` and `2 , 2` are both on:
@ -12,7 +12,7 @@ if (led.point(1,1) && led.point(2,2)) {
}
```
### Example: Comparisons of numbers and strings
## Example: Comparisons of numbers and strings
When you compare two Numbers, you get a Boolean value, such as the comparison `x < 5` in the code below:

View File

@ -2,7 +2,7 @@
## #examples
### Example: adjusting screen brightness
## Example: adjusting screen brightness
If the [light level](/reference/input/light-level) is `< 100`, this code sets the brightness to `255` when the button A is pressed:

View File

@ -1,3 +1,3 @@
# @extends
### #specific
## #specific

View File

@ -2,7 +2,7 @@
## #examples
### Example: Count to 4
## Example: Count to 4
This program will show the numbers 0, 1, 2, 3, and 4 one after another on the LED screen.

View File

@ -2,7 +2,7 @@
## #examples
### Example: diagonal line
## Example: diagonal line
The following example uses a while loop to make a diagonal line on the LED screen (points `0, 0`, `1, 1`, `2, 2`, `3, 3`, `4, 4`).

View File

@ -6,7 +6,7 @@ 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*.
### Storing numbers in variables
## Storing numbers in variables
This program makes the variable `item` equal `5` and then shows it on the [LED screen](/device/screen).
@ -15,7 +15,7 @@ let item = 5
basic.showNumber(item)
````
### Storing strings in variables
## Storing strings in variables
This program makes the variable `name` equal `Joe` and then shows it on the [LED screen](/device/screen).
@ -24,13 +24,13 @@ let name = "Joe"
basic.showString(name);
````
### Notes
## Notes
You can use the assignment operator with variables of
every [type](/types). A *type* is which kind of thing
a variable can store, like a number or string.
### See also
## See also
[variable](/blocks/variables/var), [types](/types)

View File

@ -2,7 +2,7 @@
## #examples
### Example: show the value of a variable
## Example: show the value of a variable
Use the assignment operator to set the value of a [variable](/blocks/variables/var). Change the value of a variable from 0 to 1 using the change item block. Then display the new value of the variable on the LED screen. Like this:

View File

@ -2,7 +2,7 @@
How to define and use local variables.
### @parent language
## @parent language
A variable is a place where you can store and retrieve data. Variables have a name, a [type](/types), and value:
@ -10,7 +10,7 @@ A variable is a place where you can store and retrieve data. Variables have a na
* *type* refers to the kind of data a variable can store
* *value* refers to what's stored in the variable
### Var statement
## Var statement
Use the Block Editor variable statement to create a variable
and the [assignment operator](/blocks/variables/assign)
@ -35,7 +35,7 @@ A variable is created for the number returned by the [brightness](/reference/led
let b = led.brightness();
```
### Using variables
## Using variables
Once you've defined a variable, just use the variable's name whenever you need what's stored in the variable. For example, the following code shows the value stored in `counter` on the LED screen:
@ -52,7 +52,7 @@ counter = counter + 10;
basic.showNumber(counter);
```
### Why use variables?
## Why use variables?
If you want to remember and modify data, you'll need a variable.
A counter is a great example:
@ -65,7 +65,7 @@ input.onButtonPressed(Button.A, () => {
});
```
### Local variables
## Local variables
Local variables exist only within the function or block of code where they're defined. For example:
@ -77,11 +77,11 @@ if (led.brightness() > 128) {
}
```
#### Notes
### Notes
* You can use the default variable names if you'd like, however, it's best to use descriptive variable names. To change a variable name in the editor, select the down arrow next to the variable and then click "new variable".
### See also
## See also
[types](/types), [assignment operator](/blocks/variables/assign)