NDCell
NDCell copied to clipboard
Support turmite rulestrings
Tentative notation
[ and ] represent literal characters. < and > do not.
<turmite type>[<transitions per internal state>]<turmite type>isTurmite,AbsoluteTurmite,TriTurmite, orHexTurmite<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= leftR= rightU= upD= down
Absolute directions
E= eastW= westN= northS= southU= upD= down
3D orientation changes
l= roll 90 degrees counterclockwiser= roll 90 degrees clockwisef= 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: