Reporter Blocks in SNAP!

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:

Reporter BlocksOr the following blocks in Operators palette:

Reporter Blocks in SNAP! - Operator Blocks

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.

  1. 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:
    X Position Reporter Block in SNAP!Reporter Blocks in SNAP! - Reporter Block Value in 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.
  1. Drag the reporter block into the scripting area and click on it. You should see a little speech balloon next to the block, like:
    Drag the reporter block into the scripting area and click on it. You should see a little speech balloon next to the block
    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:

  1. 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.
  2. 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.

Share This:

Leave a Reply

Your email address will not be published. Required fields are marked *