Distributed Task Example (Counting Blinks)

This is really interesting. I’ve been puzzling over how to detect a victory condition across all blinks, and this is part of it, I think.

I was using a message system very similar to yours, to broadcast state when connected, or when state changed.

Then I maintain an array in each Blink holding the known state of all connected Blinks, indexed by their unique serial number. Then each Blink looks at their local array to verify that a victory condition is satisfied. If it is, send a message requesting confirmation from all Blinks, and update the state array to reflect “confirm victory” as a state. Then display the victory animation.

I don’t see a way around maintaining the local copy of the state of all Blinks. Do you?

1 Like