Skip to content

Add Langton's Ant Hole #2038

Description

@kTheLemon

Description
Langton's ant simulation, each cell can be in any integer state. Rulesets are passed in as a series of L's and R's corresponding to left/right turns on certain cell states (the first character for the first state, second character for the second state etc...). The ant should first turn, then increment the cell it lands on's state, looping if it reaches the maximum (which would be the number of rules), and finally move forward.

The goal would be to print the 1000th step after the initial configuration (an 33x33 grid filled with state 0 cells with the ant facing upwards in the middle).

Example input

LR

Ideally there would be a maximum of 10 rules passed in so that each cell can intuitively be represented as a single symbol. Rules should just be passed in as a string.

Example output

000000000000000000000000000000000
000000000001111110000000000000000
000000001110000001000000000000000
000000000100000000100000000000000
000000001101001000100000000000000
000000001001011101000000000000000
000000000010101001110000000000000
000000011111100101011000000000000
000000011111000110110100000000000
000000001110100110100100000000000
000000001000101010101000000000000
000000010001101010100000000000000
000000100001010110000000000000000
000000101011010111000000000000000
000000010110011001010100000000000
000000000010110000011100000000000
000000001010111110001000000000000
000000010010110000110000000000000
000000010110100000000000000000000
000000001100000000000000000000000
000000000110000000000000000000000
000000000000000000000000000000000
000000000000000000000000000000000
000000000000000000000000000000000
000000000000000000000000000000000
000000000000000000000000000000000
000000000000000000000000000000000
000000000000000000000000000000000
000000000000000000000000000000000

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions