logo
Home Games CRM32Pro C/C++ Code Updated
 
 
bg

 Home

  dot  News
  dot  About us
  dot  Forum
  dot  Weblog
  dot  Links
 

Games

  dot  HX project
  dot  SpacePong
  dot  TitanBomber
 

      CRM32Pro

  dot  Overview
  dot  EditorDPF
  dot  SetupProject
  dot  AddIns
  dot  Reference Guide
  dot  Examples
  dot  Downloads
 

     C/C++ Code

 
 

Español

   

Langton's Ant overview

         Simple program that uses the algorithm of the Langton's Ant with a customizable implementation (using an external file) to recreate a virtual world of ants.  

     The operation of an ant is very simple:

 
- It makes its first movement given an initial direction.
 
- If the cell where it moves is non-RED, it changes it to RED and perform a turn of 90º at right.
 
- If the cell where it moves is RED, it changes it to non-RED and perform a turn of 90º at left.

     As you can see, the rules are very simple ones, so... where is the interesting thing? you only must run the program and after about 10,000 steps, the ant will create almost-symmetrical landscapes and it will begin to create a diagonal highway. It seems that each ant suddenly know what want to do. Many of you will say that it could be random event but far from it, we can do whatever we want with these ants: put a lot of them, put obstacles, etc.. but all of them always ended up doing his diagonal highway, you should test it!

     From a technical point of view, Langton's Ant is a simple and deterministic discrete dynamical system. It can be viewed as a cellular automaton, as a two-dimensional Turing machine, or as an agent-system. When I say that it's discrete, I mean that there is a discrete world, which is updated in discrete time. The world is usually a bidimensional square grid but is possible to code it in other ways such as triangular grid, hexagonal grid,etc. Each position in the grid (called cells) has a state, which can be either red or non-red. The ant walks on the grid, moving according to the states it finds, and changing these states as it walks over them.

    The source code is free and modifiable. It compiles with Visual Studio 6, any Visual Studio .Net and GNU GCC.

     Original code is dated on 1998 running in MSDOS. It was ported to SDL and Win32/Linux in 2002.
   
 
   

Langton's Ant source code, binaries and screenshots

   
 
  Win32 Linux i386

Source code

Download

Binaries

Latest version

 v1.0

Changes

--

 
 

Screenshot

Screenshot

   
 
 
Copyright (c) 2007 MegaStorm Systems. All rights reserved.