NDCell icon indicating copy to clipboard operation
NDCell copied to clipboard

Support turmite rulestrings

Open HactarCE opened this issue 4 years ago • 0 comments

Tentative notation

[ and ] represent literal characters. < and > do not.

  • <turmite type>[<transitions per internal state>]
  • <turmite type> is Turmite, AbsoluteTurmite, TriTurmite, or HexTurmite
  • <transitions per internal state> is a |-separated list of <transitions per tile state>
  • <transitions per tile state> is a ,-separated list of <transition>
  • <transition> is <new tile state><directions>
  • <new tile state> is a non-negative integers less than the number of tiles
  • <directions> is a list of <direction> with no separator
    • If no directions are listed, the turmite disappears
    • If multiple directions are listed, the turmite is cloned
  • <direction> is a relative or absolute direction (depending on the type of turmite) optionally followed by a 3D orientation change optionally followed by a new internal state, which is a non-negative integer less than the number of internal states

Relative directions

  • F = forwards (no turn)
  • B = backwards (180 turn left/right)
  • L = left
  • R = right
  • U = up
  • D = down

Absolute directions

  • E = east
  • W = west
  • N = north
  • S = south
  • U = up
  • D = down

3D orientation changes

  • l = roll 90 degrees counterclockwise
  • r = roll 90 degrees clockwise
  • f = roll 180 degrees

Examples

  • Langton's Ant: Turmite[1R,0L]
  • Langton's LLRR Ant: Turmite[1R,2R,3L,0L]
  • Highway 2074575: AbsoluteTurmite[1N1,1W0|0S1,1N1|1S3,1S2|0N2,0E1]

Other considerations

3D orientation may be determined by using the previous "forward" direction of the turmite as the new "up" direction.

It may be worth creating a more concise Ant[...] generator with limited capabilities.

See also:

HactarCE avatar Mar 18 '21 22:03 HactarCE