Inputs and Conditionals
Lesson
The Ask and Wait Block
functions similar to the
block but waits for a response from the user. The response is stored in the
block and can be referenced later. Only one input is stored at a time, so asking a new question will delete the previous answer.
This script where the user specifies both the size and the number of squares, will not work as intended because the size will replace the number of squares.
Conditionals
A Conditional Block is used to make a choice between executing two different chunks of code.
The If block chooses between executing code or not
The If/Else block provides a choice between two code paths. Only one of the bodies, either the If or the Else, will ever be executed.
Last updated
Was this helpful?