For each lab, we'll provide you with starter projects that you can save to your account.
When you open the project, you'll see this single block in the "Scripts" area (the central space of the Snap! window):
Every Snap! program is made up of blocks like
say hello that tell the computer what to do. This block says hello to someone in a specified language.
You just saw how changing the inputs to a block changed its output. Now let's introduce some terminology.
say helloblock is a reporter block. That means that it does some sort of computation and then "reports" the result. When you click it, the computer runs its code, and you see the reported result in a bubble, like this:
say hello, accept inputs that customize what they do, and those inputs show up as spaces you can edit. The
say helloblock accepts two inputs, a name and a language. You can change the inputs to change the output (in this case, the reported greeting).
There are lots of blocks in Snap!, and you can even make your own. For this first project, most of the blocks are hidden, but you should see a block in the palette on the left.
fancyblock somewhere below the
say helloblock in the Scripts area.
fancyblock, and click it to see the output. Does it look… Ƒᵃ𝐍𝓬у?
fancyblock into the first input slot of the
say helloblock, replacing the name from before, and click the block to see the output.
That's the power of reporter blocks! You can use the output of one block as the input to another block, making a chain of computation.
Be sure to save your projects after an important change and, if you are using a shared computer, whenever you're done for the day.
fancyblocks and observed their outputs, and you dragged the
fancyblock into the
say helloblock so that the output of one block could be used as the input of the other.