In this game, you shake to "throw the dice" and send the result to the other @boardname@. If you receive a result of a dice throw equal or greater than yours, you lose.
## Dice game @fullscreen
Let's start by rebuilding the **dice** game. If you are unsure about the details, try the **dice** tutorial again.
```blocks
input.onGesture(Gesture.Shake, function () {
basic.showNumber(Math.randomRange(1, 6))
})
```
## Dice variable @fullscreen
We need to store the result of the dice cast in a variable. A **variable** is like a place in the memory of the @boardname@ where you save information, like numbers.
* Go to the **Variables** toolbox and click ``||Make a Variable||`` to create a new variable. We will call it **dice**.
* Add a ``||set dice to||`` block and drag the ``||pick random||`` into it.
* Drag a ``||dice||`` from the **Variables** toolbox into the ``||basic:show number||`` block.
```blocks
let dice = 0
input.onGesture(Gesture.Shake, function () {
dice = Math.randomRange(1, 6)
basic.showNumber(dice)
})
```
## Send the dice @fullscreen
Put in a ``||radio:send number||`` and a ``||dice||`` to send the value stored in the ``dice`` variable via radio.
```blocks
let dice = 0
input.onGesture(Gesture.Shake, function () {
dice = Math.randomRange(1, 6)
basic.showNumber(dice)
radio.sendNumber(dice)
})
```
## Receive the dice @fullscreen
Go get an ``||radio:on received number||`` event block. This event runs when a radio message from another @boardname@ arrives. The ``receivedNumber`` value is the value of the dice in this game.