This is an implementation of the Langton's Ant cellular automaton.
- Install Kotlin 1.3.
- Clone the repository using one of the following methods.
- SSH:
git clone git@github.com:neelkamath/langtons-ant.git
- HTTPS:
git clone https://github.com/neelkamath/langtons-ant.git
- SSH:
cd langtons-ant
- Run using
<GRADLE> run --args="<STEPS> <ROWS> <COLUMNS> <ROW> <COLUMN> <DIRECTION>"
. Replace<GRADLE>
withgradle.bat
if you're on Windows, and./gradlew
on others. All the following arguments are optional.<STEPS>
(200
by default) are the number of time steps the grid should progress.<ROWS>
(11
by default) and<COLUMNS>
(11
by default) are the number of rows and columns in the plane.<ROW>
(5
by default) and<COLUMN>
(5
by default) is the row and column the ant is initially on (the first row/column starts from zero).DIRECTION
(LEFT
by default) is the ant's initial direction (one ofUP
,RIGHT
,DOWN
, andLEFT
).
Each cell on the grid is indicated by two characters. The first character will be W
(white cell), or B
(black cell). The second character will be E
(empty cell), U
(has upward facing ant), R
(has rightward facing ant), D
(has downward facing ant), or L
(has a leftward facing ant).
- Windows:
gradle.bat test
- Other:
./gradlew test
This project is under the MIT License.