Here's a simple command for listing simple cellular automata. Even among these (linear, each cell has 2 neghbours and 2 states),
there are some interesting ones. This one will print 230 different ones.
perl -e 'for$r(0..511){$t=$/;@s=((0)x40,1,($r&1)x39);
for(1..28){@s=map($r>>(8-4*$s[$_-1]-2*$s[$_]-$s[$_+1])&1,
1..78);unshift@s,$s[0];push@s,$s[-1];$t.=join"",map((".",
"#")[$_],@s),$/;};$h{$t}.=sprintf"%03x ",$r;};print$h{$_},
$_ while$_=each%h;' | less
Ps: s/28/$L-2/e if your screen has
$L lines; mine has 30.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.