|Ask () and Wait|
The Ask () and Wait block is a Sensing block and a Stack block. The block will make an input box (with the specified text above it) show at the bottom of the screen. Scratchers can input text into it and submit it — the input is stored in the Answer block. The Answer block automatically updates to the latest input.
This block can be somewhat replicated with the following code:
|Note:||This does not work perfectly. See this project for more information.|
As this block allows users to input any text they want, it is widely used when a user must communicate with the project.
Some common uses for the Ask () and Wait block:
- Chatbots — receiving information from the user
ask [What's your name?] and wait say (join [Hello, ] (join (answer) [.]))
- Setting preferences — coordinates, color, and so on
ask [Color?] and wait set [color v] effect to (answer)
- Receiving input — asking the user to give a command
ask [Move how many steps?] and wait move (answer) steps