updated lesson satic page and pogo

This commit is contained in:
Michael Elliot Braun
2016-03-31 15:51:42 -07:00
parent 7c862ce0f5
commit 1439942b45
7 changed files with 185 additions and 71 deletions

View File

@ -23,7 +23,7 @@ Now let's randomly generate a number from 0 to 3 so that we can randomly display
```blocks
input.onGesture(Gesture.Shake, () => {
let randomArrow = Math.random(4)
if (randomArrow = 3) {
if (randomArrow == 3) {
basic.showLeds(`
. . # . .
. # # # .
@ -42,7 +42,7 @@ Now let's handle each of the cases by displaying the appropriate arrow. (Let's d
```blocks
input.onGesture(Gesture.Shake, () => {
let randomArrow = Math.random(4)
if (randomArrow = 3) {
if (randomArrow == 3) {
basic.showLeds(`
. . # . .
. # # # .
@ -51,7 +51,7 @@ input.onGesture(Gesture.Shake, () => {
. . # . .
`)
}
if (randomArrow = 2) {
if (randomArrow == 2) {
basic.showLeds(`
. . # . .
. . # . .
@ -70,7 +70,7 @@ Now let's handle the rest of the cases for `random arrow`.
```blocks
input.onGesture(Gesture.Shake, () => {
let randomArrow = Math.random(4)
if (randomArrow = 3) {
if (randomArrow == 3) {
basic.showLeds(`
. . # . .
. # # # .
@ -79,7 +79,7 @@ input.onGesture(Gesture.Shake, () => {
. . # . .
`)
}
if (randomArrow = 2) {
if (randomArrow == 2) {
basic.showLeds(`
. . # . .
. . # . .
@ -88,7 +88,7 @@ input.onGesture(Gesture.Shake, () => {
. . # . .
`)
}
if (randomArrow = 1) {
if (randomArrow == 1) {
basic.showLeds(`
. . # . .
. # # . .

View File

@ -9,7 +9,7 @@ Complete the following [guided tutorial](/microbit/lessons/spinner/activity), yo
```blocks
input.onGesture(Gesture.Shake, () => {
let randomArrow = Math.random(4)
if (randomArrow = 3) {
if (randomArrow == 3) {
basic.showLeds(`
. . # . .
. # # # .
@ -18,7 +18,7 @@ input.onGesture(Gesture.Shake, () => {
. . # . .
`)
}
if (randomArrow = 2) {
if (randomArrow == 2) {
basic.showLeds(`
. . # . .
. . # . .
@ -27,7 +27,7 @@ input.onGesture(Gesture.Shake, () => {
. . # . .
`)
}
if (randomArrow = 1) {
if (randomArrow == 1) {
basic.showLeds(`
. . # . .
. # # . .
@ -47,7 +47,7 @@ Modify the random number generator so that it can include new arrows we will cre
```blocks
input.onGesture(Gesture.Shake, () => {
let randomArrow = Math.random(8)
if (randomArrow = 3) {
if (randomArrow == 3) {
basic.showLeds(`
. . # . .
. # # # .
@ -56,7 +56,7 @@ input.onGesture(Gesture.Shake, () => {
. . # . .
`)
}
if (randomArrow = 2) {
if (randomArrow == 2) {
basic.showLeds(`
. . # . .
. . # . .
@ -65,7 +65,7 @@ input.onGesture(Gesture.Shake, () => {
. . # . .
`)
}
if (randomArrow = 1) {
if (randomArrow == 1) {
basic.showLeds(`
. . # . .
. # # . .
@ -90,7 +90,7 @@ Let's add more arrows that point diagonally.
```blocks
input.onGesture(Gesture.Shake, () => {
let randomArrow = Math.random(8)
if (randomArrow = 7) {
if (randomArrow == 7) {
basic.showLeds(`
. . # . .
. # # # .
@ -99,7 +99,7 @@ input.onGesture(Gesture.Shake, () => {
. . # . .
`)
}
if (randomArrow = 6) {
if (randomArrow == 6) {
basic.showLeds(`
. . # . .
. . # . .
@ -108,7 +108,7 @@ input.onGesture(Gesture.Shake, () => {
. . # . .
`)
}
if (randomArrow = 5) {
if (randomArrow == 5) {
basic.showLeds(`
. . # . .
. # # . .
@ -118,7 +118,7 @@ input.onGesture(Gesture.Shake, () => {
`)
}
if (randomArrow = 4) {
if (randomArrow == 4) {
basic.showLeds(`
. . # . .
. . . # .
@ -129,7 +129,7 @@ input.onGesture(Gesture.Shake, () => {
}
if (randomArrow = 3) {
if (randomArrow == 3) {
basic.showLeds(`
# # # # #
# # # # .
@ -139,7 +139,7 @@ input.onGesture(Gesture.Shake, () => {
`)
}
if (randomArrow = 2) {
if (randomArrow == 2) {
basic.showLeds(`
# # # # #
# # # # #
@ -149,7 +149,7 @@ input.onGesture(Gesture.Shake, () => {
`)
}
if (randomArrow = 1) {
if (randomArrow == 1) {
basic.showLeds(`
# . . . #
# # . # .