Sheep and rams game, written in JavaScript