You are a sheepdog. Bring the sheep into the fold before the night. A sheep runs away from you, so come from the far side of the flock. At night, wolves come and take the sheep that are outside the fold.
Use the arrow keys or W, A, S and D to move. Hold Shift to run. Collect the sheep into one flock first: one flock is easier to move than many small ones. Then walk behind the flock, away from the opening.
The dog does not push a sheep. Each sheep is a gen_boid process that flees from the dog that it sees (the rule flee with the target {group, dog}), and stays near the other sheep. So the flock moves away from the dog.
No sheep knows the flock. The reading "Flocks" comes from boids:flocks/2: the groups of sheep that see each other. A scattered flock is harder to move.
A sheep that comes into the fold has the group penned and other rules: it stays inside. A wolf hunts only the group sheep, so a sheep in the fold is safe.
A wolf that touches a sheep sends taken to the process of the sheep. The sheep tells the director of the field, and stops. The world removes a boid that stops.