Inputs and Conditionals

Lesson

The Ask and Wait Block

alt text functions similar to the alt text block but waits for a response from the user. The response is stored in the alt text 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.

alt text

Conditionals

A Conditional Block is used to make a choice between executing two different chunks of code.

alt text

The If block chooses between executing code or not

alt text

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?