in reply to Christmas Lights = keeping a terminal alive with a CA

Running this, I see that this is a typical "XOR-like" cellular automata, but a quick glance at the code, without any serious attempt to dissect it in detail, reveals that you're doing all the heavylifting yourself, whereas you may have perl do it for you courtesy of bitwise operators acting on strings. Here follows a minimal example exploiting them. It does something similar to yours. Of course it's left as an exercise to you to suitably golf/obfuscate it if you like. I used a similar technique in My 1st post (japh).

#!/usr/bin/perl -l use strict; use warnings; my $len=80; my $line = '!' x $len; substr +($line ^= $line), $len/2, 1, "\xFF"; { local $_=$line; y/\0\xFF/ ^/; print; my ($lf, $rt) = map { substr $line x 2, $_ % $len, $len; } 1, -1; $line=$lf ^ $rt; select undef, undef, undef, .1; redo; } __END__