Shortest Game of Life Conway's Game of Life is the classic example of cellular automation. The cells form a square grid and each has two states: alive or dead. On each turn, each cell simultaneously updates according to its state and those of its eight neighbours:


A live cell remains alive if it has exactly two or three live neighbours
A dead cell becomes alive if it has exactly three live neighbours


Your mission, should you choose to accept it, is to code the shortest Game of Life implementation in your favourite language.

The rules:


The grid must be at least 20x20
The grid must wrap around (so the grid is like the surface of a Torus)
Your implementation must allow the user to input their own starting patterns
GoL is a bit pointless if you can't see what is happening, so there must be visual output of the automaton running, with each turn's result being shown for long enough to be seen!
Python, 219 chars

I went for maximum golfage, with just enough interface to satisfy the question.

import time
P=input()
N=range(20)
while 1:
 for i in N:print''.join(' *'[i*20+j in P]for j in N)
 time.sleep(.1);Q=[(p+d)%400 for d in(-21,-20,-19,-1,1,19,20,21)for p in P];P=set(p for p in Q if 2-(p in P)&lt;Q.count(p)&lt;4)


You run it like this:

echo "[8,29,47,48,49]" | ./life.py


The numbers in the list represent the coordinates of the starting cells.  The first row is 0-19, the second row is 20-39, etc.

Run it in a terminal with 21 rows and it looks pretty snazzy.