Rule:LangtonsAnt-LLRR

From LifeWiki
Revision as of 16:06, 20 January 2020 by Ian07 (talk | contribs) (from https://github.com/gollygang/ruletablerepository)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

@RULE LangtonsAnt-LLRR

@TABLE

  1. Rule table written automatically by Langtons-Ant-gen.py
  2. for the move-sequence: LLRR
  3. A generalisation of Langton's Ant to n-colors. For each state i that the
  4. ant finds itself on:
  5. 1. turn 90 degrees R or L (depending on the i'th letter of the move sequence)
  6. 2. increment the state of the cell (modulo n)
  7. 3. move forward one square
  8. -----------------------------empty squares---------------------
  9. states 0-3
  10. ----------------------------------------------ant is here------
  11. states 4-7 : ant on a square in state 0 facing N,E,S,W
  12. states 8-11 : ant on a square in state 1 facing N,E,S,W
  13. states 12-15 : ant on a square in state 2 facing N,E,S,W
  14. states 16-19 : ant on a square in state 3 facing N,E,S,W
  15. ---------------------------------------------------------------

n_states:20 neighborhood:vonNeumann symmetries:none

  1. ----------- variables: -----------
  1. any empty square:

var a={0,1,2,3} var b={0,1,2,3} var c={0,1,2,3} var d={0,1,2,3}

  1. a square in state 0 with an ant on it:

var ant0={4,5,6,7}

  1. a square in state 1 with an ant on it:

var ant1={8,9,10,11}

  1. a square in state 2 with an ant on it:

var ant2={12,13,14,15}

  1. a square in state 3 with an ant on it:

var ant3={16,17,18,19}

  1. ----------- transitions: -----------
  1. an ant is leaving this square: increment it modulo 4

ant0,a,b,c,d,1 ant1,a,b,c,d,2 ant2,a,b,c,d,3 ant3,a,b,c,d,0

  1. an ant is entering this square:

0,a,4,c,d,7 # ant to the E facing N on state 0 turns L and advances one square 1,a,4,c,d,11 # ant to the E facing N on state 0 turns L and advances one square 2,a,4,c,d,15 # ant to the E facing N on state 0 turns L and advances one square 3,a,4,c,d,19 # ant to the E facing N on state 0 turns L and advances one square 0,a,b,5,d,4 # ant to the S facing E on state 0 turns L and advances one square 1,a,b,5,d,8 # ant to the S facing E on state 0 turns L and advances one square 2,a,b,5,d,12 # ant to the S facing E on state 0 turns L and advances one square 3,a,b,5,d,16 # ant to the S facing E on state 0 turns L and advances one square 0,a,b,c,6,5 # ant to the W facing S on state 0 turns L and advances one square 1,a,b,c,6,9 # ant to the W facing S on state 0 turns L and advances one square 2,a,b,c,6,13 # ant to the W facing S on state 0 turns L and advances one square 3,a,b,c,6,17 # ant to the W facing S on state 0 turns L and advances one square 0,7,b,c,d,6 # ant to the N facing W on state 0 turns L and advances one square 1,7,b,c,d,10 # ant to the N facing W on state 0 turns L and advances one square 2,7,b,c,d,14 # ant to the N facing W on state 0 turns L and advances one square 3,7,b,c,d,18 # ant to the N facing W on state 0 turns L and advances one square 0,a,8,c,d,7 # ant to the E facing N on state 1 turns L and advances one square 1,a,8,c,d,11 # ant to the E facing N on state 1 turns L and advances one square 2,a,8,c,d,15 # ant to the E facing N on state 1 turns L and advances one square 3,a,8,c,d,19 # ant to the E facing N on state 1 turns L and advances one square 0,a,b,9,d,4 # ant to the S facing E on state 1 turns L and advances one square 1,a,b,9,d,8 # ant to the S facing E on state 1 turns L and advances one square 2,a,b,9,d,12 # ant to the S facing E on state 1 turns L and advances one square 3,a,b,9,d,16 # ant to the S facing E on state 1 turns L and advances one square 0,a,b,c,10,5 # ant to the W facing S on state 1 turns L and advances one square 1,a,b,c,10,9 # ant to the W facing S on state 1 turns L and advances one square 2,a,b,c,10,13 # ant to the W facing S on state 1 turns L and advances one square 3,a,b,c,10,17 # ant to the W facing S on state 1 turns L and advances one square 0,11,b,c,d,6 # ant to the N facing W on state 1 turns L and advances one square 1,11,b,c,d,10 # ant to the N facing W on state 1 turns L and advances one square 2,11,b,c,d,14 # ant to the N facing W on state 1 turns L and advances one square 3,11,b,c,d,18 # ant to the N facing W on state 1 turns L and advances one square 0,a,b,c,12,5 # ant to the W facing N on state 2 turns R and advances one square 1,a,b,c,12,9 # ant to the W facing N on state 2 turns R and advances one square 2,a,b,c,12,13 # ant to the W facing N on state 2 turns R and advances one square 3,a,b,c,12,17 # ant to the W facing N on state 2 turns R and advances one square 0,13,b,c,d,6 # ant to the N facing E on state 2 turns R and advances one square 1,13,b,c,d,10 # ant to the N facing E on state 2 turns R and advances one square 2,13,b,c,d,14 # ant to the N facing E on state 2 turns R and advances one square 3,13,b,c,d,18 # ant to the N facing E on state 2 turns R and advances one square 0,a,14,c,d,7 # ant to the E facing S on state 2 turns R and advances one square 1,a,14,c,d,11 # ant to the E facing S on state 2 turns R and advances one square 2,a,14,c,d,15 # ant to the E facing S on state 2 turns R and advances one square 3,a,14,c,d,19 # ant to the E facing S on state 2 turns R and advances one square 0,a,b,15,d,4 # ant to the S facing W on state 2 turns R and advances one square 1,a,b,15,d,8 # ant to the S facing W on state 2 turns R and advances one square 2,a,b,15,d,12 # ant to the S facing W on state 2 turns R and advances one square 3,a,b,15,d,16 # ant to the S facing W on state 2 turns R and advances one square 0,a,b,c,16,5 # ant to the W facing N on state 3 turns R and advances one square 1,a,b,c,16,9 # ant to the W facing N on state 3 turns R and advances one square 2,a,b,c,16,13 # ant to the W facing N on state 3 turns R and advances one square 3,a,b,c,16,17 # ant to the W facing N on state 3 turns R and advances one square 0,17,b,c,d,6 # ant to the N facing E on state 3 turns R and advances one square 1,17,b,c,d,10 # ant to the N facing E on state 3 turns R and advances one square 2,17,b,c,d,14 # ant to the N facing E on state 3 turns R and advances one square 3,17,b,c,d,18 # ant to the N facing E on state 3 turns R and advances one square 0,a,18,c,d,7 # ant to the E facing S on state 3 turns R and advances one square 1,a,18,c,d,11 # ant to the E facing S on state 3 turns R and advances one square 2,a,18,c,d,15 # ant to the E facing S on state 3 turns R and advances one square 3,a,18,c,d,19 # ant to the E facing S on state 3 turns R and advances one square 0,a,b,19,d,4 # ant to the S facing W on state 3 turns R and advances one square 1,a,b,19,d,8 # ant to the S facing W on state 3 turns R and advances one square 2,a,b,19,d,12 # ant to the S facing W on state 3 turns R and advances one square 3,a,b,19,d,16 # ant to the S facing W on state 3 turns R and advances one square