In SNAP!, a reporter block is used to report a value, which is generally used as an input to another block.
What do reporter blocks look like?
Reporter blocks can be easily identified in the palette as they have reporter shape (round). For example, the following blocks in the Motion palette:
Or the following blocks in Operators palette:
The value reported by the reporter block depends upon the block itself. For example, x position block reports the x coordinate of the current position of sprite and y position block reports the y coordinate of the same.
How do these block report value?
There are 2 ways these blocks can report value.
- Click on the gray box to the left of these reporter blocks in the palette, and then look over to the stage. You will see that the value that the block will report is displayed on the stage. For example, when you click on the gray checkbox next to x position block, this will show up on the stage:
When you move/drag the sprite around, you will see the value in the reporter block will change, since it is showing the x coordinate of the current position of the sprite.
- Drag the reporter block into the scripting area and click on it. You should see a little speech balloon next to the block, like:
When you move/drag the sprite around and click on the block ion scripting area again and you should see the updated value.
When do you use a reporter block?
You can use reporter block:
- To see the current value of the block, either on the stage or in scripting area (as mentioned above). This is very helpful when you are trying to debug a script and see what value the block is reporting at various times.
- The input to another block. Usually, the reporter blocks are used as input to another block.
Some of the lessons in the blog are inspired by my experience teaching at TEALS. Please refer to their licensing terms before re-using this content.