# Rule 110 cellular automaton — a different program for the same runner: # python3 uts35.py rule110.txt 'gggggg*' # ICU 78.3 # 0 - Mgggggg* # 1 - Mgggggs**. # 2 - Mggggss***.. # 3 - Mgggsss**.*... # 4 - Mggssss*****.... # 5 - Mgsssss**...*..... # 6 - Mssssss***..**...... # Bounded demo, not part of the universality proof. # Cells: . = 0 and * = 1, backslash-escaped in the rules because ASCII # punctuation is reserved rule syntax. # Fuel: one g per generation. Burnt g becomes s, so columns stay aligned. # Run halts when no g is left. One pass = one generation. # The g nearest the cells launches a sweep head that carries the previous # two cells in its state (A = 00, B = 01, C = 10, D = 11) and rewrites # each cell z to rule110(x, y, z). Right edge flushes two boundary cells. g } [\.\*s] > s | A ; A s > s | A ; A \. > \. | A ; A \* > \* | B ; B \. > \* | C ; B \* > \* | D ; C \. > \. | A ; C \* > \* | B ; D \. > \* | C ; D \* > \. | D ; A > \. \. ; B > \* \. ; C > \. \. ; D > \* \. ;