2016-03-25 16:47:20 -07:00
# truth or dare lesson
2016-11-01 10:42:42 -07:00
create a love meter with the @boardname @.
2016-03-25 16:47:20 -07:00
2016-05-26 15:24:10 -07:00
2016-03-25 16:47:20 -07:00
## Topic
If (Conditionals)
## Quick Links
2016-04-13 08:27:45 -07:00
* [activity ](/lessons/truth-or-dare/activity )
2016-05-06 11:31:25 -07:00
* [tutorial ](/lessons/truth-or-dare/tutorial )
2016-04-13 08:27:45 -07:00
* [challenges ](/lessons/truth-or-dare/challenges )
* [quiz ](/lessons/truth-or-dare/quiz )
* [quiz answers ](/lessons/truth-or-dare/quiz-answers )
2016-03-25 16:47:20 -07:00
## Prior learning/place of lesson in scheme of work
Learn how to use an if statement to run code run code depending on whether a condition is true or not. We will be learning how to create the game truth or dare using input an if statement, a local variable, math random as well as simple commands, such as show string and show LEDs.
## Documentation
2016-04-04 22:33:13 -07:00
```cards
2016-03-29 16:17:34 -07:00
basic.showLeds(`
. . . . .
. . . . .
. . # . .
. . . . .
. . . . .
`)
2016-04-04 22:33:13 -07:00
input.onButtonPressed(Button.A, () => {})
2016-03-29 16:17:34 -07:00
let x = 0
2018-06-01 11:42:38 -07:00
Math.randomRange(0, 3)
2016-04-04 22:33:13 -07:00
if (true) {}
2016-03-29 16:17:34 -07:00
basic.showString("Hello!")
```
2016-03-25 16:47:20 -07:00
## Objectives
2016-11-01 10:42:42 -07:00
* learn how to display an image on the @boardname @
2016-03-25 16:47:20 -07:00
* learn how to run code when an input button is pressed
* learn how to a create a variable for a place where you can store and retrieve data
* learn how to declare a new local variable or update the value of a variable
* learn how to return a random number
* learn how to conditionally run code depending on whether a condition is true or not
* learn how to show a string on the LED screen one character at a time (scrolling from left to right)