The table below defines the laws of the Universe. The ant moves one space forwards. When it leaves a square, it turns left or right depending on the colour of the square. It then changes the colour of the square to the next in the list.

Direction Colour

what is langton's ant | langton's ant on github | more experiments | dwmkerr.com