From bbbb1ea6bc22d2f649b1f6871d75f03063da73ba Mon Sep 17 00:00:00 2001 From: Tom Ball Date: Tue, 14 Jun 2016 21:37:55 -0400 Subject: [PATCH] moving stuff around --- .../types => blocks/logic}/boolean.md | 0 docs/blocks/loops.md | 1 - docs/getting-started.md | 4 +-- docs/lessons.md | 2 -- docs/reference.md | 2 +- docs/reference/types.md | 2 +- docs/reference/types/number.md | 34 +++++++++++++------ {docs/reference => olddocs}/blocks-vs-js.md | 0 8 files changed, 28 insertions(+), 17 deletions(-) rename docs/{reference/types => blocks/logic}/boolean.md (100%) rename {docs/reference => olddocs}/blocks-vs-js.md (100%) diff --git a/docs/reference/types/boolean.md b/docs/blocks/logic/boolean.md similarity index 100% rename from docs/reference/types/boolean.md rename to docs/blocks/logic/boolean.md diff --git a/docs/blocks/loops.md b/docs/blocks/loops.md index db655e7d..b0589376 100644 --- a/docs/blocks/loops.md +++ b/docs/blocks/loops.md @@ -3,5 +3,4 @@ ```cards for(let i = 0;i<5;i++) {} while(true) {} -basic.forever(() => {}) ``` diff --git a/docs/getting-started.md b/docs/getting-started.md index fcc27ba7..543860c4 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -4,7 +4,7 @@ Are you ready to build cool BBC micro:bit programs? -Here are some challenges for you. Unscramble the blocks in the editor +Here are some challenges for you. Arrange the blocks in the editor to make real programs that work! ## ~ @@ -12,7 +12,7 @@ to make real programs that work! ### Happy face There are three blocks in the editor (the area to the left). -They should look like this: +Arrange them to look like this: ```blocks basic.forever(() => { diff --git a/docs/lessons.md b/docs/lessons.md index 817fdcab..586f2224 100644 --- a/docs/lessons.md +++ b/docs/lessons.md @@ -65,5 +65,3 @@ ### ~ ### @section full - -The lessons promote computational thinking and computer science literacy. \ No newline at end of file diff --git a/docs/reference.md b/docs/reference.md index a44a479e..c031ca4b 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -1,4 +1,4 @@ -# Microb:bit APIs +# Micro:bit APIs ```namespaces basic.showNumber(0); diff --git a/docs/reference/types.md b/docs/reference/types.md index 25f7a711..76f5a3b7 100644 --- a/docs/reference/types.md +++ b/docs/reference/types.md @@ -5,7 +5,7 @@ The following built-in types are supported for the BBC micro:bit: * **[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 +* **[Boolean](/blocks/logic/boolean)**: true or false * **[Image](/blocks/image)**: a collection of [micro:bit LED states](/device/screen) (on/off) TypeScript allows you to create user-defined classes of data. diff --git a/docs/reference/types/number.md b/docs/reference/types/number.md index 2a8168d5..dbb9c27b 100644 --- a/docs/reference/types/number.md +++ b/docs/reference/types/number.md @@ -8,9 +8,12 @@ A *Number* is an integer such as `42` or `-42`. More precisely, a *Number* is a ### Declare a number variable -Use the [var statement](/reference/variables/var) and the [assignment operator](/reference/variables/assign) declare a *local* number variable. Like this: +You can assign a number to a variable: -![](/static/mb/blocks/number-0.png) +```blocks +let num = 42; +basic.showNumber(42); +``` ### Arithmetic operators @@ -20,7 +23,7 @@ The following arithmetic operators work on numbers and return a [Number](/refere * subtraction: `1 - 3 ` * multiplication: `3 * 2` * integer division: `7 / 3` -* modulo is available through the [math library](/reference/math) +* modulo is available through the [math library](/blocks/math) ### Relational operators @@ -35,23 +38,34 @@ The following relational operators work on numbers and return a [Boolean](/refer ### 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: +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: -![](/static/mb/blocks/number-1.png) +```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`: +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`: -![](/static/mb/blocks/number-2.png) +```blocks +let brightness = led.brightness() +``` ### Math functions -The [math library](/reference/math) includes math related functions. In the [Block Editor](/blocks/editor), click `math` on the Code Keyboard to see the math functions. For example, the `absolute` function returns the returns the absolute value of input parameter `x`: +The [math library](/reference/math) includes math related functions. +For example, the `absolute` function returns the returns the absolute value of input parameter `x`: -![](/static/mb/blocks/number-3.png) +```blocks +let abs = math.absolute(-42); +basic.showNumber(abs); +``` ### See also -[math library](/reference/math), [var](/reference/variables/var), [Boolean](/reference/types/boolean), [show number](/reference/basic/show-number) +[math](/blocks/math), [var](/blocks/variables/var), [Boolean](/reference/types/boolean), [show number](/reference/basic/show-number) diff --git a/docs/reference/blocks-vs-js.md b/olddocs/blocks-vs-js.md similarity index 100% rename from docs/reference/blocks-vs-js.md rename to olddocs/blocks-vs-js.md