
We can use it to have one sprite tell another sprite to do something.
In particular, we put a script inside the grey ring and instead of running it before the tell block runs, which is when inputs are normally evaluated, it is passed to the other sprite and the other sprite runs it.
The two
blocks get evaluated in different sprites so they report different values.
Grey rings around a script make the script something that can be stored in a variable, in a list, or passed as an input to another block to be run later.
Why is this useful?
Consider this block
.
It only works because it somehow can evaluate its condition multiple times.
If it only evaluated it once, the loop would always run either zero times or forever.
But it’s a special block built into Snap!
Rings let other blocks (including one we write) have the same kind of control.
A hole with a grey ring around it accepts a script or a reporter and that code is passed as the input rather than the result of running the code.
In this lab we’re going to start by using an existing block that takes a ringed input.

The ring expects a Boolean expression.
Unlike the ringed argument to
which needs to be a complete script, the ringed argument to
should have one empty hole.

When this runs, it loops over its list input and runs the Boolean expression with each item in the list in the empty hole. It reports a new list of only those items for which the Boolean expression evaluates to true.
