Using the sprite.ask block is one way to make your program interactive. The answer to sprite.ask is stored in a variable that can be used to display the answer or for comparision in an "if" statement.
- Click on the Actions toolkit
- Drag the Ask block into the editor
Looking at the example code below, the question asked is "Yes or no?"
The answer is stored in the variable called "choice"
The variable "choice" can then be used in the program. For example, it can be displayed using the sprite.say block.
choice = sprite.ask("Yes or no?")