pxt-calliope/docs/lessons/guess-the-number/tutorial.md
2018-04-21 10:52:09 -07:00

434 B

guess the number tutorial

~avatar avatar

This tutorial will help you create a guess the number game! Let's get started!

~

Rebuild the game!

The blocks have been shuffled! Put them back together so that...

  • when the user presses button A,
    • generate a random number
    • show the number on screen
input.onButtonPressed(Button.A, () => {
    let x = Math.randomInt(10)
    basic.showNumber(x)
})