ACTIVITY 3
Lightning Challenge
Open MakeCode and load the Diversi:bit extension

1
Introduces randomness
In the "Math" section, select "Randomly choose from 0 to 100." Change the values to a time range that works for you (e.g., 1,000 to 10,000) and set it to the first pause value.

3
Decide the winner
Under “Input,” select “when A is pressed.” Inside, add the “If...then” conditional from the “Logic” section and add the variable as a condition.

5
Replicate the code
for button B

7
Assemble the image blocks
In the "Basic" section, select the blocks. You can change the icon on the screen to a sound to make it more accessible.

2
Create a variable
In "Variables," create a new variable. Below the loop you created, add "Set Variable" and set the "Logic" section to "true."

4
Within this conditional, you can put whatever you want to identify the winner, but at the end you should always put "Set Variable" and set the value to "False."

6
Test your reflexes!
Upload the code to Microbit and choose a partner.
It's time to challenge your teammates and see who has the best reflexes!
