Deleted loop around event handlers in coin flipper

This commit is contained in:
Ron Hale-Evans 2016-06-07 11:44:42 -07:00
parent bd835a8a6e
commit 6de2f22542

View File

@ -234,7 +234,6 @@ Here are the blocks to make your coin flipper. When you press button
on the LED screen. on the LED screen.
```blocks ```blocks
basic.forever(() => {
input.onButtonPressed(Button.B, () => { input.onButtonPressed(Button.B, () => {
if (Math.randomBoolean()) { if (Math.randomBoolean()) {
basic.showString("H"); basic.showString("H");
@ -242,14 +241,12 @@ basic.forever(() => {
basic.showString("T"); basic.showString("T");
} }
}); });
});
``` ```
### ~hint ### ~hint
The ``pick random true or false`` block randomly tells the ``if`` The ``pick random true or false`` block randomly tells the ``if``
block `true` or `false`. If the ``pick`` block block `true` or `false`. If the ``pick`` block picked `true`, the
picked `true`, the ``if`` block shows the letter `H`. Otherwise, it ``if`` block shows the letter `H`. Otherwise, it shows the letter `T`.
shows the letter `T`.
That's it! That's it!
@ -280,7 +277,6 @@ show your score.
When you're done, your coin flipping program should look like this: When you're done, your coin flipping program should look like this:
```blocks ```blocks
basic.forever(() => {
input.onButtonPressed(Button.B, () => { input.onButtonPressed(Button.B, () => {
if (Math.randomBoolean()) { if (Math.randomBoolean()) {
basic.showString("H"); basic.showString("H");
@ -294,7 +290,6 @@ basic.forever(() => {
input.onButtonPressed(Button.AB, () => { input.onButtonPressed(Button.AB, () => {
basic.showNumber(game.score()); basic.showNumber(game.score());
}); });
});
``` ```
Flip until your thumbs get tired! Flip until your thumbs get tired!