This is Langton's ant, a mathmatical reperensentation of chaos. This follows a simple rule- if touching a black square, turn 90 degrees left, but if touching a white square, then turn 90 degrees right.