Screenshots
Wator
Source Code
 previous   up   next 

Planet Wator Predator-Prey simulation with sharks and fish.

This program simulates the planet WATOR as described in Scientific American Computer Recreations column, Dec 1984. WATOR (or Wa-Tor) is a toroidal (donut-shaped) planet inhabited by fish and sharks. The form of a torus was used to simplify the implementation (a torus can be constructed by connecting the opposite sides of a rectangle). The name WATOR is just a shortcut for water torus. The fish feed on a ubiquitous plankton and the sharks feed on the fish. Time passes in discrete jumps or cycles. During each cycle, fish move randomly to an unoccupied square, and reproduce if old enough. Sharks move to a square occupied by a fish and eat it, if possible, or move to an open square if no meals are available. Sharks will also breed if old enough, but will starve if they do not eat within a specified period of time.

Parameters selected at the beginning of the run are as follows:

  • nfish: Number of fish at start of run-distributed randomly.
  • nsharks: Number of sharks at start, also distributed randomly.
  • fbreed: Number of cycles a fish must exist before reproducing.
  • sbreed: Number of cycles sharks must exist before reproducing.
  • starve: Number of cycles a shark has to find food before starving.

On the screen, fish are green and sharks are blue. After the initial screen is displayed, press any key to start the simulation. During the run, pressing any key will stop the program.


Planet Wator simulation

Planet Wator simulation

 previous   up   next