Skip to content

Instantly share code, notes, and snippets.

@CrispyPin
Created May 7, 2024 07:47
Show Gist options
  • Save CrispyPin/8ff74172f951746be686fe9127e985e1 to your computer and use it in GitHub Desktop.
Save CrispyPin/8ff74172f951746be686fe9127e985e1 to your computer and use it in GitHub Desktop.
Rule 110 in MarkovJunior

add <model name="rule_110" size="30" steps="5000" gui="220" gif="True" pixelsize="16"/> to models.xml

This can definitely be implemented with less states and less steps, I just wanted to prove it could be done and didn't know how to specify rule symmetry.

<sequence values="BWAFSRPNCEM" origin="True">
<!--
definitions:
A ALIVE
B DEAD
W, F, S rail setup
P rail direction
N pointer rail
C COPY, (moving left)
E EXECUTE, (moving right)
M MOVE after a COPY
R MOVE after an EXECUTE
"left" and "right" are relative to the rules, in practice the initial orientation is random.
ffmpeg.exe -framerate 60 -start_number 0 -i './output/%d.png' -vframes 5000 -pix_fmt yuv420p rule_110.mp4
-->
<markov>
<sequence origin="False">
<!-- seed -->
<one in="*W*" out="FNS"/>
<!-- grow rail -->
<one in="BFN" out="FNN"/>
<one in="BSN" out="SNN"/>
<!-- tail of rail with initial alive cell -->
<one in="**/**/SN/**/**" out="*A/**/NN/**/*A"/>
<!-- head of rail -->
<one in="NF/**" out="PN/*C"/>
</sequence>
</markov>
<markov>
<sequence>
<markov>
<sequence>
<!-- copy cell down -->
<one in="PN/BC/*A/**" out="PN/*M/**/*A"/>
<one in="PN/BC/*B/**" out="PN/*M/**/*B"/>
<!-- move left, ready for copy -->
<one in="NPN/BBM" out="PNN/BCB"/>
</sequence>
</markov>
<!-- flip to right, enter executing mode-->
<one in="PNN/BMB" out="NNP/BEB"/>
<markov>
<sequence>
<one in="NNP/BEB/***/AAA" out="***/*R*/*B*/***"/>
<one in="NNP/BEB/***/BAA" out="***/*R*/*A*/***"/>
<one in="NNP/BEB/***/ABA" out="***/*R*/*A*/***"/>
<one in="NNP/BEB/***/BBA" out="***/*R*/*B*/***"/>
<one in="NNP/BEB/***/AAB" out="***/*R*/*A*/***"/>
<one in="NNP/BEB/***/BAB" out="***/*R*/*A*/***"/>
<one in="NNP/BEB/***/ABB" out="***/*R*/*A*/***"/>
<one in="NNP/BEB/***/BBB" out="***/*R*/*B*/***"/>
<!-- move right, ready for execute-->
<one in="NPN/RBB" out="NNP/BEB"/>
</sequence>
</markov>
<!-- flip to left, enter copy mode-->
<one in="NNP/BRB" out="PNN/BCB"/>
</sequence>
</markov>
</sequence>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment