From abed962eaba9f7a1b2f9e69047e836a6a2d0ce8a Mon Sep 17 00:00:00 2001 From: Michael Elliot Braun Date: Wed, 30 Mar 2016 17:15:42 -0700 Subject: [PATCH] updated lessons --- docs/lessons.md | 1 + .../bop-it/activity.md} | 22 +++++------- .../js => }/lessons/bop-it/quiz-answers.md | 0 .../{reference/js => }/lessons/bop-it/quiz.md | 0 .../offset-image/activity.md} | 8 ++--- .../lessons/offset-image/quiz-answers.md | 0 .../js => }/lessons/offset-image/quiz.md | 0 docs/{reference/js => }/lessons/prank-wifi.md | 4 +-- .../prank-wifi/activity.md} | 36 ++++++++----------- .../lessons/prank-wifi/quiz-answers.md | 14 ++++---- .../js => }/lessons/prank-wifi/quiz.md | 0 11 files changed, 36 insertions(+), 49 deletions(-) rename docs/{reference/js/lessons/bop-it/challenges.md => lessons/bop-it/activity.md} (86%) rename docs/{reference/js => }/lessons/bop-it/quiz-answers.md (100%) rename docs/{reference/js => }/lessons/bop-it/quiz.md (100%) rename docs/{reference/js/lessons/offset-image/challenges.md => lessons/offset-image/activity.md} (91%) rename docs/{reference/js => }/lessons/offset-image/quiz-answers.md (100%) rename docs/{reference/js => }/lessons/offset-image/quiz.md (100%) rename docs/{reference/js => }/lessons/prank-wifi.md (67%) rename docs/{reference/js/lessons/prank-wifi/challenges.md => lessons/prank-wifi/activity.md} (79%) rename docs/{reference/js => }/lessons/prank-wifi/quiz-answers.md (94%) rename docs/{reference/js => }/lessons/prank-wifi/quiz.md (100%) diff --git a/docs/lessons.md b/docs/lessons.md index 856cda08..04b7a996 100644 --- a/docs/lessons.md +++ b/docs/lessons.md @@ -59,6 +59,7 @@ Overview of lessons for the BBC micro:bit. * [Telegraph](/microbit/lessons/telegraph), play the telegraph game between two BBC micro:bits ## Advanced +* [Prank WiFi](/microbit/lessons/prank-wifi), create fake WiFi to trick your friends * [Speed Button](/microbit/lessons/speed-button), code a speed game with running time * [Headbands](/microbit/lessons/headbands), create a charades game with a collection of strings that hold the words * [Hero](/microbit/lessons/hero), reconstruct the classic arcade game pac man with the BBC micro:bit diff --git a/docs/reference/js/lessons/bop-it/challenges.md b/docs/lessons/bop-it/activity.md similarity index 86% rename from docs/reference/js/lessons/bop-it/challenges.md rename to docs/lessons/bop-it/activity.md index 6a623678..4f36a9bb 100644 --- a/docs/reference/js/lessons/bop-it/challenges.md +++ b/docs/lessons/bop-it/activity.md @@ -4,13 +4,9 @@ a game similar to "Simon Says" with the BBC micro:bit. #docs ## Before we get started -Complete the following guided tutorial: +Complete the following guided tutorial. Your code should look like this: -* [tutorial](/microbit/lessons/bop-it/tutorial) - -At the end of the tutorial, click `keep editing`. Your code should look like this: - -``` +```blocks newAction() // *** input.onButtonPressed(Button.A, () => { if (action == 0) { @@ -21,27 +17,27 @@ input.onButtonPressed(Button.A, () => { input.onLogoDown(() => { if (action == 1) { game.addScore(1) // *** - newAction() // *** + newAction() } -}) // *** +}) input.onGesture(Gesture.Shake, () => { if (action == 2) { - game.addScore(1) // *** - newAction() // *** + game.addScore(1) + newAction() } -}) // *** +}) input.onButtonPressed(Button.B, () => { basic.showNumber(game.score(), 150) // *** basic.pause(2000) // *** newAction() // *** -}) // *** +}) ``` ### Challenge 1 Now let's add some more types of instructions for the player to follow. Let's add `PRESS PIN 0`. Change the global variable `action` to `math->random(4)` so that we can add a new **IF** statement that checks if `action=3`. If it does, display instructions to press pin 0. -``` +```blocks /** * {highlight} */ diff --git a/docs/reference/js/lessons/bop-it/quiz-answers.md b/docs/lessons/bop-it/quiz-answers.md similarity index 100% rename from docs/reference/js/lessons/bop-it/quiz-answers.md rename to docs/lessons/bop-it/quiz-answers.md diff --git a/docs/reference/js/lessons/bop-it/quiz.md b/docs/lessons/bop-it/quiz.md similarity index 100% rename from docs/reference/js/lessons/bop-it/quiz.md rename to docs/lessons/bop-it/quiz.md diff --git a/docs/reference/js/lessons/offset-image/challenges.md b/docs/lessons/offset-image/activity.md similarity index 91% rename from docs/reference/js/lessons/offset-image/challenges.md rename to docs/lessons/offset-image/activity.md index 879b4084..f2ce36f7 100644 --- a/docs/reference/js/lessons/offset-image/challenges.md +++ b/docs/lessons/offset-image/activity.md @@ -4,13 +4,9 @@ Coding challenges for the offset image tutorial. #docs ## Before we get started -Complete the following guided tutorial: +Complete the following exercise. Your code should look like this: -* [tutorial](/microbit/lessons/offset-image/tutorial) - -At the end of the tutorial, click `keep editing`. Your code should look like this: - -``` +```blocks offset = 0 basic.forever(() => { if (offset == -4) { diff --git a/docs/reference/js/lessons/offset-image/quiz-answers.md b/docs/lessons/offset-image/quiz-answers.md similarity index 100% rename from docs/reference/js/lessons/offset-image/quiz-answers.md rename to docs/lessons/offset-image/quiz-answers.md diff --git a/docs/reference/js/lessons/offset-image/quiz.md b/docs/lessons/offset-image/quiz.md similarity index 100% rename from docs/reference/js/lessons/offset-image/quiz.md rename to docs/lessons/offset-image/quiz.md diff --git a/docs/reference/js/lessons/prank-wifi.md b/docs/lessons/prank-wifi.md similarity index 67% rename from docs/reference/js/lessons/prank-wifi.md rename to docs/lessons/prank-wifi.md index f63ff4dc..9e4a513b 100644 --- a/docs/reference/js/lessons/prank-wifi.md +++ b/docs/lessons/prank-wifi.md @@ -4,6 +4,6 @@ create a fake wifi app to trick your friends #abs #acceleration #if #math #plot create a fake wifi app to trick your friends -* [tutorial](/microbit/lessons/prank-wifi/tutorial) +* [activity](/microbit/lessons/prank-wifi/activity) * [quiz](/microbit/lessons/prank-wifi/quiz) -* [challenges](/microbit/lessons/prank-wifi/challenges) + diff --git a/docs/reference/js/lessons/prank-wifi/challenges.md b/docs/lessons/prank-wifi/activity.md similarity index 79% rename from docs/reference/js/lessons/prank-wifi/challenges.md rename to docs/lessons/prank-wifi/activity.md index 017e9537..d81b4d4f 100644 --- a/docs/reference/js/lessons/prank-wifi/challenges.md +++ b/docs/lessons/prank-wifi/activity.md @@ -4,13 +4,9 @@ create a fake wifi app to trick your friends. #docs ## Before we get started -Complete the following guided tutorial: +Complete the following exercise. Your code should look like this: -* [tutorial](/microbit/lessons/prank-wifi/tutorial) - -At the end of the tutorial, click `keep editing`. Your code should look like this: - -``` +```blocks basic.showString("Check Wifi", 150) basic.forever(() => { let xAccel = math.abs(input.acceleration("x")) @@ -18,7 +14,7 @@ basic.forever(() => { let zAccel = math.abs(input.acceleration("z")) let sum = xAccel + yAccel + zAccel if (sum < 1400) { - basic.plotImage(` + basic.showleds(` . . . . . . . . . . . . # . . @@ -26,7 +22,7 @@ basic.forever(() => { # # # . . `) } else if (sum >= 1400 && sum < 1680) { - basic.plotImage(` + basic.showleds(` . . . . . . . . # . . . # # . @@ -35,7 +31,7 @@ basic.forever(() => { `) } else if (sum >= 1680) { - basic.plotImage(` + basic.showleds(` . . . . . . . . . . . . . . . @@ -52,11 +48,9 @@ What if wanted to show the maximum connectivity of wifi instead of just 1, 3, or Let's start by changing the first **IF** statement to `if sum <1200`. -Edit this line: **if** sum <1400 **then** +Edit this line: if sum is greater than 1400 then just click on the `1400` and backspace until you can add your own number of `1200`. -Just click on the `1400` and backspace until you can add your own number of `1200`. - -``` +```blocks basic.showString("Check Wifi", 150) basic.forever(() => { let xAccel1 = math.abs(input.acceleration("x")) @@ -64,7 +58,7 @@ basic.forever(() => { let zAccel1 = math.abs(input.acceleration("z")) let sum1 = xAccel1 + yAccel1 + zAccel1 if (sum1 < 1200) { - basic.plotImage(` + basic.showleds(` . . . . . . . . . . . . # . . @@ -72,7 +66,7 @@ basic.forever(() => { # # # . . `) } else if (sum1 >= 1400 && sum1 < 1680) { - basic.plotImage(` + basic.showleds(` . . . . . . . . # . . . # # . @@ -81,7 +75,7 @@ basic.forever(() => { `) } else if (sum1 >= 1680) { - basic.plotImage(` + basic.showleds(` . . . . . . . . . . . . . . . @@ -96,7 +90,7 @@ basic.forever(() => { Let's add an **IF** at the bottom of your code that checks to see if `sum >= to 1200` **and** if `sum <1400` -``` +```blocks basic.showString("Check Wifi", 150) basic.forever(() => { let xAccel2 = math.abs(input.acceleration("x")) @@ -104,7 +98,7 @@ basic.forever(() => { let zAccel2 = math.abs(input.acceleration("z")) let sum2 = xAccel2 + yAccel2 + zAccel2 if (sum2 < 1200) { - basic.plotImage(` + basic.showleds(` . . . . . . . . . . . . # . . @@ -112,7 +106,7 @@ basic.forever(() => { # # # . . `) } else if (sum2 >= 1400 && sum2 < 1680) { - basic.plotImage(` + basic.showleds(` . . . . . . . . # . . . # # . @@ -121,7 +115,7 @@ basic.forever(() => { `) } else if (sum2 >= 1680) { - basic.plotImage(` + basic.showleds(` . . . . . . . . . . . . . . . @@ -130,7 +124,7 @@ basic.forever(() => { `) } if (sum2 >= 1200 && sum2 < 1400) { - basic.plotImage(` + basic.showleds(` . . . . # . . . # # . . # # # diff --git a/docs/reference/js/lessons/prank-wifi/quiz-answers.md b/docs/lessons/prank-wifi/quiz-answers.md similarity index 94% rename from docs/reference/js/lessons/prank-wifi/quiz-answers.md rename to docs/lessons/prank-wifi/quiz-answers.md index b3a3751b..d072d84e 100644 --- a/docs/reference/js/lessons/prank-wifi/quiz-answers.md +++ b/docs/lessons/prank-wifi/quiz-answers.md @@ -14,7 +14,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
-``` +```blocks let xAccel = math.abs(input.acceleration("x")) let yAccel = math.abs(input.acceleration("y")) let zAccel = math.abs(input.acceleration("z")) @@ -28,7 +28,7 @@ let zAccel = math.abs(input.acceleration("z"))
-``` +```blocks let sum = xAccel + yAccel + zAccel ``` @@ -38,9 +38,9 @@ let sum = xAccel + yAccel + zAccel
-``` +```blocks if (sum < 1400) { - basic.plotImage(` + basic.showleds(` . . . . . . . . . . . . # . . @@ -58,9 +58,9 @@ if (sum < 1400) {
-``` +```blocks if (sum >= 1400 && sum < 1680) { - basic.plotImage(` + basic.showleds(` . . . . . . . . # . . . # # . @@ -80,7 +80,7 @@ if (sum >= 1400 && sum < 1680) { ``` if (sum >= 1680) { - basic.plotImage(` + basic.showleds(` . . . . . . . . . . . . . . . diff --git a/docs/reference/js/lessons/prank-wifi/quiz.md b/docs/lessons/prank-wifi/quiz.md similarity index 100% rename from docs/reference/js/lessons/prank-wifi/quiz.md rename to docs/lessons/prank-wifi/quiz.md