Войти
  • 3373Просмотров
  • 6 лет назадОпубликованоIvan Vlahov

Multiple Langtons ants simulation

I made a class named Ant which takes care of ant's position, color sequence and tasks - where to turn after changing each color. Each ant starts with the same (background) color to deal with and they all have the same cycle in which they swap colors. However, the sides to which they turn are different. Video 1: 2 ants, 4 colors Left ant goes RLRR (right when it 'sees' the first color, left for the second color, right for the third color, and right for the fourth) Right ant goes RLLR Video 2: 2 ants, 4 colors Left ant goes RLLR Right ant goes RLRL Video 3: 2 ants, 6 colors Left ant goes RLRLLR Right ant goes RRLRLR Video 4: 2 ants, 6 colors Left ant goes RLLLRR Right ant goes RLLRLR Video 5: 3 ants, 4 colors Left ant goes RLLR Middle ant goes LRLL Right ant goes RLRR If you want to read more about Langton's ant: %27s_ant