Wa-Tor is a population dynamics simulation devised by A. K. Dewdney[1] and presented in the December 1984 issue of Scientific American in a five-page article entitled "Computer Recreations: Sharks and fish wage an ecological war on the toroidal planet Wa-Tor".
Wa-Tor is usually implemented as a two-dimensional grid with three colours, one for fish, one for sharks and one for empty water. If a creature moves past the edge of the grid, it reappears on the opposite side. The sharks are predatory and eat the fish. Both sharks and fish live, move, reproduce and die in Wa-Tor according to the simple rules defined below. From these simple rules, complex emergent behavior can be seen to arise.
The balance of this ecosystem is very delicate: the populations of two species can follow hugely different cycles depending on the given parameters (such as reproduction cycles and the time period in which a shark must eat to avoid starvation) as well as starting positions of each being. It may go from both species being endangered to an abundance of one or both.
When the prey are numerous, predators can reproduce rapidly. But this increase in turn increases the number of prey hunted and the population of the prey decreases. When the prey becomes rarer, predators begin to starve and die of starvation, decreasing their population and easing the hunting pressure on the prey. The prey (and in time predator) can then go back to rapidly reproducing as the cycle repeats itself.
In the long run there are three possible scenarios in Wa-Tor:
The first scenario can be very difficult to obtain, where a kind of equilibrium is achieved in which the two populations fluctuate periodically. In most cases, the amount of fish is reduced to an almost endangered state, then the shark population rapidly falls due to shortage of food. This allows the fish population to grow again until the shark population can meet this growth.
The extinction of both animals occurs when sharks exceed in number to a point where they eat all the fish. As the fish were the only source of food for sharks they will inevitably die of starvation.
Conversely, if the initial number of fish is low, or the sharks have a very short period of starvation, the second scenario occurs. In this case the sharks will become extinct, leaving the field open to the fish.