Paterson's worms

Paterson's worms are an example of cellular automata. The rules of this system are described in the Wikipedia page; you can find another good reference here. The goal is to take as many steps as possible, i.e. to make the worm grow as much as possible. The worm dies if it passes through a point already traveled or if it reaches one of the borders (boundary conditions are not implemented yet).
At first, press SPACE to create a rule (integer number from 0 to 5, default 0) and then press ENTER to append it in the list. You have to repeat this process for each rule you want; if you press p you will see the current list of rules (press space one more time if you want to continue to add new rules). Once you are ready, press s to start the simulation (the origin coincides more or less with the center of the grid).
Click here to go back to the home page.