From 18e637aa28fd732231d5e4dd8885c6caf6042e46 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Wed, 13 Apr 2016 08:48:42 -0700 Subject: [PATCH] remove "to create new script..." --- docs/lessons/banana-keyboard/challenges.md | 2 -- docs/lessons/beautiful-image/activity.md | 2 -- docs/lessons/blink/activity.md | 2 -- docs/lessons/charting/activity.md | 2 -- docs/lessons/classic-beatbox/activity.md | 2 -- docs/lessons/flashing-heart/activity.md | 2 -- docs/lessons/game-counter/activity.md | 2 -- docs/lessons/glowing-pendulum/activity.md | 2 -- docs/lessons/happy-birthday/activity.md | 2 -- docs/lessons/light-beatbox/activity.md | 23 ++++--------------- docs/lessons/love-meter/activity.md | 2 -- docs/lessons/lucky-7/activity.md | 2 -- docs/lessons/pogo/activity.md | 2 -- docs/lessons/rock-paper-scissors/activity.md | 2 -- docs/lessons/rotation-animation.md | 1 - docs/lessons/temperature/activity.md | 2 -- docs/lessons/zoomer/activity.md | 2 -- docs/reference/js/lessons/counter/activity.md | 2 -- .../reference/js/lessons/die-roll/activity.md | 2 -- .../js/lessons/flashing-heart/activity.md | 2 -- .../js/lessons/glowing-pendulum/activity.md | 2 -- .../js/lessons/guess-the-number/activity.md | 2 -- .../js/lessons/love-meter/activity.md | 2 -- docs/reference/js/lessons/lucky-7/activity.md | 2 -- docs/reference/js/lessons/magic-8/activity.md | 14 +++++------ .../lessons/rock-paper-scissors/activity.md | 8 +++---- docs/reference/js/lessons/spinner/activity.md | 2 -- .../js/lessons/truth-or-dare/activity.md | 2 -- docs/reference/js/lessons/zoomer/activity.md | 2 -- 29 files changed, 13 insertions(+), 83 deletions(-) diff --git a/docs/lessons/banana-keyboard/challenges.md b/docs/lessons/banana-keyboard/challenges.md index 65b3ef20..afeb7428 100644 --- a/docs/lessons/banana-keyboard/challenges.md +++ b/docs/lessons/banana-keyboard/challenges.md @@ -6,8 +6,6 @@ control images with variables. Control images with variables. -To create a new script, go to the [Create Code](/create-code) page and tap *New Project* under *Block Editor*. - Have you ever tried to making beat box sounds? Let's try making a beatbox with code! We will register an event handler on the fruit that will execute when two things occur: first, the alligator clip attaches to GND and the other side of the alligator clip is inserted into a banana. Let's start by adding a variable where you can store data. Then rename the variable to "sound". Then set the value of the variable to the note block `A` from the Music drawer. Modify your code so that your code looks like this. diff --git a/docs/lessons/beautiful-image/activity.md b/docs/lessons/beautiful-image/activity.md index 6735578a..d4d4524a 100644 --- a/docs/lessons/beautiful-image/activity.md +++ b/docs/lessons/beautiful-image/activity.md @@ -10,8 +10,6 @@ Let's learn how to show an image on the LED screen. ### ~ -To create a new script, go to the [Create Code](/create-code) page and tap *New Project* under the *Block Editor*. - We will use *show LEDs* to draw an image on the LED screen. This function immediately writes on the screen. ```blocks diff --git a/docs/lessons/blink/activity.md b/docs/lessons/blink/activity.md index 4cedee1a..647bfcef 100644 --- a/docs/lessons/blink/activity.md +++ b/docs/lessons/blink/activity.md @@ -6,8 +6,6 @@ Turn an LED on and off with forever ### @video td/videos/blink-0 -To create a new script, go to the [Create Code](/create-code) page and tap *New Project* under *Block Editor*. - ### ~ Have you ever tried to blink a flashlight at night? The concept is fairly simply: turn on the light, wait for a little, turn off the light, wait again, and repeat. That's exactly what we need to code to get a blinking LED. diff --git a/docs/lessons/charting/activity.md b/docs/lessons/charting/activity.md index cbb41cf5..4835edef 100644 --- a/docs/lessons/charting/activity.md +++ b/docs/lessons/charting/activity.md @@ -4,8 +4,6 @@ Measure the acceleration on the micro:bit in the "z" direction. ### ~avatar avatar -To create a new script, go to the [Create Code](/create-code) page and tap `New Project` under `Block Editor`. - ### ~ Welcome! This activity will teach how to use the 1st micro:bit to chart the second micro:bit's acceleration in the "x" direction. Let's get started! diff --git a/docs/lessons/classic-beatbox/activity.md b/docs/lessons/classic-beatbox/activity.md index 07d2cce3..af223e62 100644 --- a/docs/lessons/classic-beatbox/activity.md +++ b/docs/lessons/classic-beatbox/activity.md @@ -2,8 +2,6 @@ Control images with variables. -To create a new script, go to the [Create Code](/create-code) page and tap *New Project* under *Block Editor*. - Have you ever tried to making beat box sounds? Let's try making a beatbox with code! Let's start by adding a variable where you can store data. Then rename the variable to "sound". Then set the value of the variable to the note block `A` from the Music drawer. Modify your code so that your code looks like this. diff --git a/docs/lessons/flashing-heart/activity.md b/docs/lessons/flashing-heart/activity.md index b846302b..c9c866e8 100644 --- a/docs/lessons/flashing-heart/activity.md +++ b/docs/lessons/flashing-heart/activity.md @@ -10,8 +10,6 @@ In this activity, you will learn how to blink an image on the LED screen. ### ~ -To create a new script, go to the [Create Code](/create-code) page and tap *New Project* under *Block Editor*. - Let's start by adding code that plots a heart image on the screen using `show LEDs`. Once you are done coding, don't forget to run your code in the simulator or the micro:bit. diff --git a/docs/lessons/game-counter/activity.md b/docs/lessons/game-counter/activity.md index 946a9c84..49305571 100644 --- a/docs/lessons/game-counter/activity.md +++ b/docs/lessons/game-counter/activity.md @@ -6,8 +6,6 @@ Turn an LED on and off with forever loop ### @video td/videos/counter-0 -To create a new script, go to the [Create Code](/create-code) page and tap *New Project* under *Block Editor*. - ### ~ Have you ever tried to create a game counter? The concept is fairly simply: increase the game `score` with `on button pressed` . diff --git a/docs/lessons/glowing-pendulum/activity.md b/docs/lessons/glowing-pendulum/activity.md index c9208178..40a705fe 100644 --- a/docs/lessons/glowing-pendulum/activity.md +++ b/docs/lessons/glowing-pendulum/activity.md @@ -2,8 +2,6 @@ Construct a pendulum that glows using acceleration. -To create a new script, go to the [Create Code](/create-code) page and tap `New Project` under `Block Editor`. - Welcome! This activity will teach how to construct a pendulum that glows using acceleration. Let's get started! Create a **forever** loop that will constantly display the appropriate brightness on the LED display. diff --git a/docs/lessons/happy-birthday/activity.md b/docs/lessons/happy-birthday/activity.md index 6d927bcb..1602e85c 100644 --- a/docs/lessons/happy-birthday/activity.md +++ b/docs/lessons/happy-birthday/activity.md @@ -2,8 +2,6 @@ Play sounds with music blocks. -To create a new script, go to the [Create Code](/create-code) page and tap `New Project` under `Block Editor`. - Have you ever tried to play a song on an instrument? Let's try coding the song "Happy Birthday" on the micro:bit ! Let's start by adding the code in the music drawer that includes a single musical chord (or pitched sound) with the `play` block. Then insert the chord "C". Once you are done coding, don't forget to run your code in the simulator or the micro:bit. diff --git a/docs/lessons/light-beatbox/activity.md b/docs/lessons/light-beatbox/activity.md index ac84b1e3..b39a7c1f 100644 --- a/docs/lessons/light-beatbox/activity.md +++ b/docs/lessons/light-beatbox/activity.md @@ -8,40 +8,30 @@ Have you ever tried to making beat box sounds based on the light level? Let's tr ### ~ -To create a new script, go to the [Create Code](/create-code) page and tap *New Project* under *Block Editor*. - Let's start by adding a variable where you can store data. Then rename the variable to "light". Then set the value of the variable to the block `light level` from the Input drawer. This will gets the `light level` from 0 (dark) to 255 (bright). The light is measured by using various LEDs from the screen. Modify your code so that your code looks like this. ```blocks - let light = 0; -light = input.lightLevel(); +let light = input.lightLevel(); ``` We want to play music on button pressed in order to register an event handler that will execute whenever when you run a script and click on button pressed on the simulator. We must start by opening the Input drawer and adding `on button pressed` A. Then add a block `rest` to plays nothing for a `1/16` beat. Modify your code so that your code looks like this. ```blocks - -let light = 0; input.onButtonPressed(Button.A, () => { music.rest(music.beat(BeatFraction.Sixteenth)); - light = input.lightLevel(); + let light = input.lightLevel(); }); - - - - ``` We click on the Logic drawer then insert a `if do` that will conditionally run code depending on whether the Boolean condition is true or false. Then insert the variable `light` into the first part of the inequality. The variable "light" will appear in the Variables drawer. Finally, we insert 25. Modify your code so that your code looks like this. If the `light level` is `less than` 25, play `ring tone` `C`. If this conditions is not true, play `ring tone` `A`. ```blocks -let light = 0; input.onButtonPressed(Button.A, () => { music.rest(music.beat(BeatFraction.Sixteenth)); - light = input.lightLevel(); + let light = input.lightLevel(); if (light < 25) { music.ringTone(music.noteFrequency(Note.C)); } @@ -55,11 +45,9 @@ input.onButtonPressed(Button.A, () => { We click on the Logic drawer then insert a `less than` sign into the first `if` conditional that will conditionally run code depending on whether the Boolean condition is true or false. Continue this logic to continue with these conditional statements. Click on the Logic drawer. Then we want to add additional conditional statements by clicking on the gear to the left of the `if`. Add 05 `else if` and 01 `else` inside the `if do` block structure. If the `light level` is `less than` 50, play `ring tone` ``D``. If the `light level` is `less than` 100, play `ring tone` ``E``. If the `light level` is `less than` 150, play `ring tone` ``F`` If the `light level` is `less than` 180, play `ring tone` ``G``. If these conditions are not true, `ring tone` ``A``. ```blocks - - let light = 0; input.onButtonPressed(Button.A, () => { music.rest(music.beat(BeatFraction.Sixteenth)); - light = input.lightLevel(); + let light = input.lightLevel(); if (light < 25) { music.ringTone(music.noteFrequency(Note.C)); } @@ -79,9 +67,6 @@ input.onButtonPressed(Button.A, () => { music.ringTone(music.noteFrequency(Note.A)); } }); - - - ``` * click *compile* and run your code on the micro:bit. diff --git a/docs/lessons/love-meter/activity.md b/docs/lessons/love-meter/activity.md index 4b0b05bc..b6704b21 100644 --- a/docs/lessons/love-meter/activity.md +++ b/docs/lessons/love-meter/activity.md @@ -8,8 +8,6 @@ Create a love meter with the micro:bit Welcome! This activity will help you create a love meter with the micro:bit. Let's get started! -To create a new script, go to the [Create Code](/create-code) page and tap *New Project* under *Block Editor*. - ### ~ Begin by registering an event with `on pin pressed` *P0* to know when someone is holding pin *P0* and pin *Gnd*. diff --git a/docs/lessons/lucky-7/activity.md b/docs/lessons/lucky-7/activity.md index 6c111b50..f172296e 100644 --- a/docs/lessons/lucky-7/activity.md +++ b/docs/lessons/lucky-7/activity.md @@ -10,8 +10,6 @@ Let's learn how to show the lucky number 7 on the LED screen. ### ~ -To create a new script, go to the [Create Code](https://www.microbit.co.uk/create-code) page and tap `New Project` under **Block Editor**. - We will use `show number` to display a number on the screen. The argument (`7`) is the number to display. ```blocks diff --git a/docs/lessons/pogo/activity.md b/docs/lessons/pogo/activity.md index d1b566e5..d8a3941c 100644 --- a/docs/lessons/pogo/activity.md +++ b/docs/lessons/pogo/activity.md @@ -2,8 +2,6 @@ Construct a counter that uses acceleration. -To create a new script, go to the [Create Code](/create-code) page and tap `New Project` under `Block Editor`. - Welcome! This activity will teach how to construct a pendulum that glows using acceleration. Let's get started! Create a **forever** loop that will constantly display the appropriate brightness on the LED display. Now let's measure the acceleration on the `y` axis and store that value in a variable. The `acceleration(y)` function will provide the value. diff --git a/docs/lessons/rock-paper-scissors/activity.md b/docs/lessons/rock-paper-scissors/activity.md index ca97fb21..6e22c58e 100644 --- a/docs/lessons/rock-paper-scissors/activity.md +++ b/docs/lessons/rock-paper-scissors/activity.md @@ -10,8 +10,6 @@ Welcome! This tutorial will help you create a game of rock paper scissors with t ### ~ -To create a new script, go to the [Create Code](/create-code) page and tap *New Project* under **Touch Develop**. - We want the micro:bit to choose rock, paper, or scissors when it is shaken. Let's begin by creating an on shake condition so the micro:bit will run code when it is shaken. diff --git a/docs/lessons/rotation-animation.md b/docs/lessons/rotation-animation.md index cad2b6b3..058d1805 100644 --- a/docs/lessons/rotation-animation.md +++ b/docs/lessons/rotation-animation.md @@ -31,7 +31,6 @@ basic.showLeds(` `) basic.pause(100) while (true) {} -basic.pause(20) ``` ## Objectives diff --git a/docs/lessons/temperature/activity.md b/docs/lessons/temperature/activity.md index 58399e9a..4cea83ab 100644 --- a/docs/lessons/temperature/activity.md +++ b/docs/lessons/temperature/activity.md @@ -2,8 +2,6 @@ Measure the temperature on the micro:bit -To create a new script, go to the [Create Code](/create-code) page and tap `New Project` under `Block Editor`. - Welcome! This activity will teach how to measure the temperature on the micro:bit. Let's get started! We want to display the temperature on shake. In order to do so, we need to register the event `on shake` that will execute whenever the user shakes the micro:bit; in the web browser, click the button labelled "SHAKE" under the simulator to generate a shake event diff --git a/docs/lessons/zoomer/activity.md b/docs/lessons/zoomer/activity.md index 47ad660e..ddfb663e 100644 --- a/docs/lessons/zoomer/activity.md +++ b/docs/lessons/zoomer/activity.md @@ -8,8 +8,6 @@ Measure the acceleration on the micro:bit in the "z" direction. ### ~ -To create a new script, go to the [Create Code](/create-code) page and tap `New Project` under `Block Editor`. - Welcome! This activity will teach how to measure the acceleration on the micro:bit in the "z" direction. Let's get started! We want to display the acceleration forever. In order to do so, we need a `forever` loop. diff --git a/docs/reference/js/lessons/counter/activity.md b/docs/reference/js/lessons/counter/activity.md index f953b7aa..de8f5ae5 100644 --- a/docs/reference/js/lessons/counter/activity.md +++ b/docs/reference/js/lessons/counter/activity.md @@ -10,8 +10,6 @@ Welcome! This tutorial will teach you how to make a counter that increments when ### ~ -To create a new script, go to the [Create Code](/create-code) page and tap *New Project* under **Touch Develop**. - Let's start by creating a **local variable** `count` to keep track of the current count. ``` diff --git a/docs/reference/js/lessons/die-roll/activity.md b/docs/reference/js/lessons/die-roll/activity.md index 127b112d..e2dcb26a 100644 --- a/docs/reference/js/lessons/die-roll/activity.md +++ b/docs/reference/js/lessons/die-roll/activity.md @@ -2,8 +2,6 @@ Create a die on the BBC micro:bit -To create a new script, go to the [Create Code](/create-code) page and tap *New Project* under **KindScript**. - Let's create a condition for when the BBC micro:bit is shaken. ``` diff --git a/docs/reference/js/lessons/flashing-heart/activity.md b/docs/reference/js/lessons/flashing-heart/activity.md index ca2b4db7..69124521 100644 --- a/docs/reference/js/lessons/flashing-heart/activity.md +++ b/docs/reference/js/lessons/flashing-heart/activity.md @@ -10,8 +10,6 @@ In this activity, you will learn how to blink an image on the LED screen. ### ~ -To create a new script, go to the [Create Code](https://www.microbit.co.uk/create-code) page and tap `New Project` under **KindScript**. - Let's start by adding code that plots a heart image on the screen using `basic->plot image`. Once you are done coding, don't forget to run your code in the simulator or the BBC micro:bit. ``` diff --git a/docs/reference/js/lessons/glowing-pendulum/activity.md b/docs/reference/js/lessons/glowing-pendulum/activity.md index 18496365..04c98bac 100644 --- a/docs/reference/js/lessons/glowing-pendulum/activity.md +++ b/docs/reference/js/lessons/glowing-pendulum/activity.md @@ -8,8 +8,6 @@ Welcome! This guided activity will teach how to construct a pendulum that glows ### ~ -To create a new script, go to the [Create Code](/create-code) page and tap *New Project* under **Touch Develop**. - Create a **forever** loop that will constantly display the appropriate brightness on the LED display. ``` diff --git a/docs/reference/js/lessons/guess-the-number/activity.md b/docs/reference/js/lessons/guess-the-number/activity.md index 0d5e1d7f..fc1c42c6 100644 --- a/docs/reference/js/lessons/guess-the-number/activity.md +++ b/docs/reference/js/lessons/guess-the-number/activity.md @@ -10,8 +10,6 @@ Welcome! This tutorial will help you create a guess the number game! Let's get s ### ~ -To create a new script, go to the [Create Code](/create-code) page and tap New Project under **Touch Develop**. - Add an event handler when button `A` is pressed. ``` diff --git a/docs/reference/js/lessons/love-meter/activity.md b/docs/reference/js/lessons/love-meter/activity.md index c0504a64..e9ebb406 100644 --- a/docs/reference/js/lessons/love-meter/activity.md +++ b/docs/reference/js/lessons/love-meter/activity.md @@ -10,8 +10,6 @@ Welcome! This tutorial will help you create a love meter with the BBC micro:bit. ### ~ -To create a new script, go to the [Create Code](/create-code) page and tap *New Project* under **Touch Develop**. - Begin by registering an event with `input->on pin pressed(PO)` to know when someone is holding pin ``P0`` and pin ``Gnd``. ``` diff --git a/docs/reference/js/lessons/lucky-7/activity.md b/docs/reference/js/lessons/lucky-7/activity.md index f78b4630..60a36d83 100644 --- a/docs/reference/js/lessons/lucky-7/activity.md +++ b/docs/reference/js/lessons/lucky-7/activity.md @@ -10,8 +10,6 @@ Let's learn how to show the lucky number 7 on the LED screen. ### ~ -To create a new script, go to the [Create Code](https://www.microbit.co.uk/create-code) page and tap `New Project` under **Touch Develop**. - We will use `basic->show number` to display a number on the screen. The first argument (`7`) is the number to display and the second argument (`150`) is duration in milliseconds between column scroll. For example, you can reduce `150` to `100` to speed up the scrolling. ``` diff --git a/docs/reference/js/lessons/magic-8/activity.md b/docs/reference/js/lessons/magic-8/activity.md index 34ab2549..cf98991f 100644 --- a/docs/reference/js/lessons/magic-8/activity.md +++ b/docs/reference/js/lessons/magic-8/activity.md @@ -8,17 +8,15 @@ Welcome! This tutorial will help you create a magic 8 ball on the BBC micro:bit. ### ~ -To create a new script, go to the [Create Code](/create-code) page and tap *New Project* under **Touch Develop**. - Show a string to instruct the user how to play Magic 8! The magic 8 ball can only answer true or false questions. -``` +```blocks basic.showString("Ask a question", 150) ``` Display the number 8. -``` +```blocks basic.showString("Ask a question", 150) basic.showNumber(8, 150) ``` @@ -27,7 +25,7 @@ basic.showNumber(8, 150) Register code to run when the BBC micro:bit is shaken. -``` +```blocks basic.showString("Ask a question", 150) basic.showNumber(8, 150) input.onGesture(Gesture.Shake, () => { @@ -40,7 +38,7 @@ Set **x** equal to a random number with a limit of 3. Remember the random function in the math library, picks a random number from 0 to the limit, but not including the limit unless it is 0. -``` +```blocks basic.showString("Ask a question", 150) basic.showNumber(8, 150) input.onGesture(Gesture.Shake, () => { @@ -52,7 +50,7 @@ Create an if statement for the condition `if x= 2`. If **x** is 2, display the string 'Yes' -``` +```blocks basic.showString("Ask a question", 150) basic.showNumber(8, 150) input.onGesture(Gesture.Shake, () => { @@ -67,7 +65,7 @@ Create an if statement for the condition `if x = 1`. If ``x`` is 1, display the string 'No' -``` +```blocks basic.showString("Ask a question", 150) basic.showNumber(8, 150) input.onGesture(Gesture.Shake, () => { diff --git a/docs/reference/js/lessons/rock-paper-scissors/activity.md b/docs/reference/js/lessons/rock-paper-scissors/activity.md index f872de9d..579fbd2d 100644 --- a/docs/reference/js/lessons/rock-paper-scissors/activity.md +++ b/docs/reference/js/lessons/rock-paper-scissors/activity.md @@ -10,18 +10,16 @@ Welcome! This tutorial will help you create a game of rock paper scissors with t ### ~ -To create a new script, go to the [Create Code](/create-code) page and tap *New Project* under **Touch Develop**. - We want the BBC micro:bit to choose rock, paper, or scissors when it is shaken. Let's begin by creating an `input->on shake` condition so the micro:bit will run code when it is shaken. -``` +```blocks input.onGesture(Gesture.Shake, () => { }) ``` Next, create an image that contains 3 frames: rock, paper, and scissors. We will control which image is shown with `offset`. -``` +```blocks input.onGesture(Gesture.Shake, () => { let img = images.createImage(` . . . . . # # # # # . . . . # @@ -35,7 +33,7 @@ input.onGesture(Gesture.Shake, () => { The BBC micro:bit will look like it's showing 1 frame of the image by displaying the whole image with plot frame and math random. We can help the BBC micro:bit randomly decide which offset to using plot image by math random. The BBC micro:bit will randomly pick the image to display with plot image and the `math->random(3)` function. -``` +```blocks input.onGesture(Gesture.Shake, () => { let img1 = images.createImage(` . . . . . # # # # # . . . . # diff --git a/docs/reference/js/lessons/spinner/activity.md b/docs/reference/js/lessons/spinner/activity.md index 9cb56f34..491d23be 100644 --- a/docs/reference/js/lessons/spinner/activity.md +++ b/docs/reference/js/lessons/spinner/activity.md @@ -2,8 +2,6 @@ create an arrow that randomly points to a player. #docs -To create a new script, go to the [Create Code](/create-code) page and tap *New Project* under **Touch Develop**. - Let's begin by adding an `input->on shake` condition to know when the BBC micro:bit is shaken. ``` diff --git a/docs/reference/js/lessons/truth-or-dare/activity.md b/docs/reference/js/lessons/truth-or-dare/activity.md index bf777777..2f38bead 100644 --- a/docs/reference/js/lessons/truth-or-dare/activity.md +++ b/docs/reference/js/lessons/truth-or-dare/activity.md @@ -2,8 +2,6 @@ a multi-player game that forces each player to reveal a secret or something funny. #docs -To create a new script, go to the [Create Code](/create-code) page and tap *New Project* under **Touch Develop**. - Begin by plotting an "up-arrow" image, which will point to someone. ``` diff --git a/docs/reference/js/lessons/zoomer/activity.md b/docs/reference/js/lessons/zoomer/activity.md index 41279941..a2c63496 100644 --- a/docs/reference/js/lessons/zoomer/activity.md +++ b/docs/reference/js/lessons/zoomer/activity.md @@ -10,8 +10,6 @@ Welcome! This tutorial will teach how to measure the acceleration on the micro:b ### ~ -To create a new script, go to the [Create Code](/create-code) page and tap *New Project* under **Touch Develop**. - We want to display the acceleration forever. In order to do so, we need a `basic->forever` loop. ```