2016-05-06 20:31:25 +02:00
|
|
|
# truth or dare tutorial
|
|
|
|
|
2017-09-07 22:42:08 +02:00
|
|
|
## ~avatar avatar
|
2016-05-06 20:31:25 +02:00
|
|
|
|
2016-05-27 00:24:10 +02:00
|
|
|
|
2016-05-06 20:31:25 +02:00
|
|
|
|
2016-11-01 18:42:42 +01:00
|
|
|
The *Truth or dare!* game works as follows: a player spins the @boardname@ on the table.
|
2016-11-02 01:44:37 +01:00
|
|
|
When the @boardname@ stops spinning, the player pointed by the arrow (displayed on screen) must press the button "A"
|
2016-05-06 20:31:25 +02:00
|
|
|
to see if she has to provide a *truth* or a *dare*.
|
|
|
|
|
2017-09-07 22:42:08 +02:00
|
|
|
## ~
|
2016-05-06 20:31:25 +02:00
|
|
|
|
2017-09-07 22:42:08 +02:00
|
|
|
## Rebuild the game!
|
2016-05-06 20:31:25 +02:00
|
|
|
|
|
|
|
The blocks have been shuffled! Put them back together so that...
|
2016-11-02 01:44:37 +01:00
|
|
|
* an up arrow is displayed when the @boardname@ is powered on.
|
2016-05-06 20:31:25 +02:00
|
|
|
* on button `A` is pressed,
|
|
|
|
* randomly display "TRUTH" or "DARE" on the screen
|
|
|
|
* show the up arrow again.
|
|
|
|
|
|
|
|
```shuffle
|
|
|
|
basic.showLeds(`
|
|
|
|
. . # . .
|
|
|
|
. # # # .
|
|
|
|
# # # # #
|
|
|
|
. . # . .
|
|
|
|
. . # . .
|
|
|
|
`)
|
|
|
|
input.onButtonPressed(Button.A, () => {
|
2018-04-21 19:52:09 +02:00
|
|
|
let random = Math.randomInt(2)
|
2016-05-06 20:31:25 +02:00
|
|
|
if (random == 0) {
|
|
|
|
basic.showString("TRUTH")
|
|
|
|
} else {
|
|
|
|
basic.showString("DARE")
|
|
|
|
}
|
|
|
|
basic.showLeds(`
|
|
|
|
. . # . .
|
|
|
|
. # # # .
|
|
|
|
# # # # #
|
|
|
|
. . # . .
|
|
|
|
. . # . .
|
|
|
|
`)
|
|
|
|
})
|
|
|
|
```
|
2017-09-07 22:42:08 +02:00
|
|
|
## Hints and tips
|
2016-05-06 20:31:25 +02:00
|
|
|
Cut out these documentation cards to help you!
|
|
|
|
|
|
|
|
```cards
|
|
|
|
basic.showLeds(`
|
|
|
|
. . # . .
|
|
|
|
. # # # .
|
|
|
|
# . # . #
|
|
|
|
. . # . .
|
|
|
|
. . # . .
|
|
|
|
`);
|
2018-04-21 19:52:09 +02:00
|
|
|
Math.randomInt(2);
|
2016-05-06 20:31:25 +02:00
|
|
|
basic.showString("TRUTH");
|
|
|
|
if (true) {} else {}
|
|
|
|
"TRUTH";
|
|
|
|
0;
|
|
|
|
input.onButtonPressed(Button.A, () => {});
|
|
|
|
```
|
|
|
|
|