Twenty-four sheep are grazing. Get them all into the pen in the top corner. Sheep run from the dog, bunch towards each other, and otherwise mind their own business. Point, drag or use the arrow keys; the dog runs to wherever you point.
Herd them yourself first. You will probably find that rushing in scatters them, and that the trick is to circle round behind and walk in slowly, flicking out to the side when one wanders off.
Then press The study's dog. It follows two rules and nothing else: if the flock is tight, walk in behind it on the far side from the pen; if one sheep has strayed too far, go round behind that sheep and push it back in. Turn on Show what the dog is doing and watch its trail: the side-to-side weave that real sheepdogs do comes out of those two rules. Nobody wrote it in.
Last, set the sheep to keep close to only their 3 nearest. The flock stops behaving like one animal and falls apart into little groups, and both you and the study's dog will find it much harder. The notes explain why that was the surprising part of the research.