mclangc/examples/rule110.mcl

37 lines
513 B
Plaintext
Raw Normal View History

mem 98 + 1 @8
0 while dup 98 < do
0 while dup 100 < do
dup mem + !8 if
mem 100 + 42 @8
else
mem 100 + 32 @8
end
1 mem 100 + 1 1 syscall3 drop
1 +
end
drop
mem 100 + 10 @8
1 mem 100 + 1 1 syscall3 drop
// pattern
mem !8 1 shl
mem 1 + !8
bor
1 while dup 98 < do
swap 1 shl 7 band
over mem + 1 + !8 bor
2dup 110 swap shr 1 band
swap mem + swap @8
swap
1 +
end
drop drop
1 +
end
drop