Java Applett
Our first java assignment was to create the game Langton’s ant but with our own code, creating our own classes and source, and use different colours and rules for however many ants we created. I found this sort of coding very difficult to get to grips with at first but it challenged me Positively and overcome many problems.
Langton's ant is a two-dimensional Turing machine with a very simple set of rules, invented by Chris Langton.
Squares on a plane are colored variously either black or white. We arbitrarily identify one square as the "ant". The ant can travel in any of the four cardinal directions at each step it takes. The ant moves according to the rules below:
At a black square, turn 90° right, flip the color of the square, move forward one unit
At a white square, turn 90° left, flip the color of the square, move forward one unit
These simple rules lead to surprisingly complex behavior: after an initial period of apparently chaotic behavior, the ant appears invariably to start building a road of 104 steps that repeat indefinitely - regardless of the pattern you start off with.