Langton's Ant Algorithm - Python and Pygame

preview_player
Показать описание
Langton's ant is a two-dimensional Turing machine with a very simple set of rules but complex emergent behavior. It was invented by Chris Langton in 1986 and runs on a square lattice of black and white cells.

The idea is: when the ant is in a white square, it will turn right 90º and go foward one square. If the square the ant is in is black, it will turn left 90º and go foward. As the ant leave the previous square, it changes the state to the oposite color.

Around the iteration number 10000, the ant will get caught in a loop, usually called "the highway", where the same pattern will be drawn forever.

Рекомендации по теме
Комментарии
Автор

hello can you please link me the code?

spyros
welcome to shbcf.ru