Before this unit, you nested blocks inside each other so that the output reported by one block became the input to another. That style of programming is known as functional programming, and in Snap!, it uses reporter blocks. A reporter computes a value and reports it (to you or to other blocks).
In this unit, you've been stacking blocks that carry out actions, such as playing a note. This style of programming is called imperative programming. In Snap!, imperative programming uses command blocks. A command tells the computer to do something, (play a sound, draw, move, change something, etc.). Commands have effects.
The shapes of the blocks go with the shapes of the places where you can use them. Reporters are round, and they go into round slots in a block. Commands are more rectangular, and they have a tab at the bottom that fits into the gap at the top of another command block. Snap! won't let you put a reporter in a stack of commands or put a command in a round slot.
A reporter block does a calculation and reports the result. Reporters have an oval shape.
A predicate is a special kind of reporter that asks a true/false question and reports either true or false. Predicates have a hexagon shape.
A command block tells the computer to do something without reporting a value. Commands have a puzzle shape and can be snapped together one after another.
You've created a reporter block before. You can create a command block in almost exactly the same way.
Note to Mary for later: Older instantiations of this image in Sparks 1.2.2 and CSP 1.2.4 need to be updated for the new palette list ordering. Also the "text box label 'Type a title for your block'" and "label 'Select a shape'" are both gone now. And "with no label of which 'for all sprites' is selected" could be deleted. --MF, 2/9/22
No, it's this picture that should change. The "new ordering" was a bug, now fixed. Also, should this picture be made at zoom level 1 instead of 1.5 so that it looks the way students will see it (with the category chooser centered etc.)? --bh 3/3/22
mystery song
.
BRIAN, would you be happy with "Category" both in the pic and in the text? For example: "Choose the category for your block: Sound. ... Select the shape for your block: Command." I understand your point about correlation, but something someone once told me about hobgoblins comes to mind. ;) I think "category" and "shape" will be more helpful to students than "Choose the color for your block: Sound." or "Select the report behavior [or "range"] for your block: Command." even if the two I suggest are a bit mis-matched. Thanks for reviewing this! --MF, 2/18/22
I'm happy as it is! I just commented because you asked. I think we probably shouldn't change it to "category" here unless we're going to do that systematically through the curriculum, both curricula actually, and that's probably not on. -bh 2/21/22
mystery song
.By the way, I always try to get people to distinguish between a command, which is a block you find in the palette, and an instruction, which is a command with its input slots filled in. This is parallel to the distinction between a reporter and an expression. I'm not suggesting we teach kids to obsess over this, but I'd be happier if we just modeled that use of language so students who are reading closely might pick up on it. --bh 3/3/22
Are you making a suggestion for this text here or a general remark. Please feel free to remove this comment and address as you see fit. --MF, 3/6/22
When you create a reporter, the block editor opens with attached to the hat block, and whatever input you give to
report
will be the value reported by the new reporter. When you create a command, the block editor opens with only the hat block, and the blocks attached below it will run (one at a time) when the new command is run.
Hiding away the details of how code works (such as by moving it inside a new block) is a form of abstraction.
mystery song
block, either build a new song for someone else to guess or drag in a song you have already created and attach it to the mystery song
hat block.