1 of 5

October 26

Check out Langton's Ant simulation at:

https://josephpetitti.com/ant

2 of 5

Introducing Langton’s Ant project

3 of 5

Langton's Ant rules:

The ant is placed onto the board that is filled with white spaces, and starts moving forward. For each step:

1) If the ant is on a white space, turn right 90 degrees and change the space to black.

2) If the ant is on a black space, turn left 90 degrees and change the space to white.

After that, the ant moves to the next step and continues moving forward. The ant will follow these rules, and continue moving around the board, until the number of steps runs out.

4 of 5

Langton's Ant rules:

1) What does the grid look like after 8 steps?

2) What color is the square that the ant is on at step 8?

  • Use white space ' ' for a white square, and '#' for a black square.
  • Use an arrow to show the location and orientation for the ant (for the project, you will use an asterisk '*')

1) If the ant is on a white space, turn right 90 degrees and change the space to black and step forward.

2) If the ant is on a black space, turn left 90 degrees and change the space to white and step forward.

5 of 5

Homework

  • Langton's Ant documentation - part 1 in Hub due Wed 8am
  • Work on Program Design, I/O