Today’s puzzle is similar to yesterday’s. It does the same thing but uses a different introductory, free coding language called Scratch, developed by MIT.
How the code works
Scratch, Blocks, and other coding languages
Our first coding puzzle used a coding language called Blocks and this puzzle uses a coding language called Scratch. Blocks and Scratch are designed to teach beginners, especially children, how to code. There are many other coding languages, some created for specific purposes and others for general use. We’ll explore them in future code puzzles.
- when space key pressed - This command tells the program to wait until the user presses the space key. This is the same as an app on your smartphone. The app starts when the user presses the app's icon.
- say "Hello world" displays the message Hello world!.
- ask "What is your name?" displays What is your name? and waits for the user to enter his/her name.
- answer is a variable that comes with Scratch. It works specifically with the answer command and stores the value that the user type in.
- say answer displays the name the user typed in.
Scratch, Blocks, and other coding languages
Our first coding puzzle used a coding language called Blocks and this puzzle uses a coding language called Scratch. Blocks and Scratch are designed to teach beginners, especially children, how to code. There are many other coding languages, some created for specific purposes and others for general use. We’ll explore them in future code puzzles.