Skip to content

Here, I implement an algorithm that calculates positions / orientations of the famous Langton's Ant problem. Langton's Ant: https://en.wikipedia.org/wiki/Langton%27s_ant

Notifications You must be signed in to change notification settings

nickyblanch/Langton-Ant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Langton-Ant

This program simulates Langton's Ant, an ant who follows very specific instructions for movement. Instead of an ant, our situation has Gary moving around on a square board of odd dimensions. The rules, simply described, are as follows: (1) Gary begins in the center cell on the board, facing upward. All cells are initially white. (2) If Gary is on a white square, he turns 90 deg clockwise and moves forward one unit. (3) If Gary is on a block square, he turns 90 deg anticlockwise and moves forward one unit.

The included .hpp/.cpp files implement a variety of user-defined classes required to solve this problem. The included FindGary.cpp file uses these classes to simulate Langton's Ant's movement. The output of the algorithm is printed to the standard output unless a file is provided as a command line argument (see documentation in code), in which case the output will be printed to a file.

About

Here, I implement an algorithm that calculates positions / orientations of the famous Langton's Ant problem. Langton's Ant: https://en.wikipedia.org/wiki/Langton%27s_ant

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages