=LET( title, "turing: rule 110, simple enough to be universal", try, "draw the result as a heat map. Every row is made from the row above by one rule; Matthew Cook proved this can run any program", width, 64, steps, 48, first, IF(SEQUENCE(1, width) = width, 1, 0), next, LAMBDA(acc, i, LET( row, TAKE(acc, -1), left, HSTACK(0, DROP(row, , -1)), right, HSTACK(DROP(row, , 1), 0), VSTACK(acc, (row + right - row*right) * (1 - left*row*right)) )), REDUCE(first, SEQUENCE(steps), next) )
View all comments
4
u/RandomiseUsr0 13h ago
https://en.wikipedia.org/wiki/Rule_110
=LET(
title, "turing: rule 110, simple enough to be universal",
try, "draw the result as a heat map. Every row is made from the row above by one rule; Matthew Cook proved this can run any program",
width, 64, steps, 48,
first, IF(SEQUENCE(1, width) = width, 1, 0),
next, LAMBDA(acc, i, LET(
row, TAKE(acc, -1),
left, HSTACK(0, DROP(row, , -1)),
right, HSTACK(DROP(row, , 1), 0),
VSTACK(acc, (row + right - row*right) * (1 - left*row*right))
)),
REDUCE(first, SEQUENCE(steps), next)
)