ConwayLife.com - A community for Conway's Game of Life and related cellular automata
Home  •  LifeWiki  •  Forums  •  Download Golly

Made a Unit Cell grid creator for b2ce3ai/s1c23-a

For scripts to aid with computation or simulation in cellular automata.

Made a Unit Cell grid creator for b2ce3ai/s1c23-a

Postby Naszvadi » October 8th, 2017, 4:05 pm

The usual bash script ripped and modified from here: ../forums/viewtopic.php?f=9&t=2604#p38065

I constructed the unit cell before, published here: ../forums/viewtopic.php?f=11&t=2597#p51602

The code:

#!/bin/bash
if [[ ! $1 =~ ^[01]+$ ]]; then
echo 'ERROR:' >&2
echo 'A finite looped cellspace must be specified (for Rule-110)' >&2
echo 'like "'"$0"' 000001"' >&2
exit 1
fi
SPACE="$1"
OUTFILE=aout.rle
cat >"$OUTFILE" <<END
#C Unit cell for Wolfram's "Rule 110".
#C Place multiple copies of this pattern in a vertical column.
#C NASZVADI P.: this Unit cell works in rule B2ce3ai/S1c23-a, 2017
#C Corollary: it is Turing-complete! Unit cell by NASZVADI P., 2017
x = 227, y = $((181*${#SPACE})), rule = B2ce3ai/S1c23-a:T0,$((181*${#SPACE}))
END
for((I=0;I<${#SPACE};++I)); do
if ((${SPACE:I:1})); then
STATE1=63b
STATE2=61b
else
STATE1=30b2o31b
STATE2=32bo28b
fi
echo -n '103b2o$103bo$105bo$104bo2bo$106b2o$32b2o$32bo2bo$34bo34b2o$36bo33bo$
35b2o31bo$66bo2bo123b2o$66b2o125bo$195bo$194bo2bo$196b2o10$75b2o$75bo
79bo$77bo10bo64b2ob2o60bo$76b2o8b2ob2o60bo2bobo59b2ob2o$84bo2bobo62bob
o3bo55bo2bobo$85bobo3bo60bo2bob2obo54bobo3bo$85bo2bob2obo57bobo2bo2b2o
b2o51bo2bob2obo$84bobo2bo2b2ob2o54b2obo8bo50bobo2bo2b2ob2o$84b2obo8bo
57bo6bo52b2obo8bo$86bo7bo58bobo5b2o53bo7bo$94b2o56b2ob2o67b2o$153bobo$
5b2o79b3o65bo61b3o$5bo2bo77bobo127bobo$7b2o77b3o127b3o$4b2o$5bo$3b2o$b
o2bo5b2o$b2o2bo4bo$o3bo3bobo$b3o2b2o6bo175b3o$bo3bo184bobo$3b2o2bo30b
2o'"$STATE1"'2o30b2o31b2o20bobo7b2o$2bo2bo3bobo24bo2bo'"$STATE2"'
o2bo32bo28bo2bo20b3o9bo$10bo27b2o'"$STATE1"'
2o30b2o31b2o20bobo7b2o21b2o$190b3o30bo2bo$100b3o87bobo
32b2o$100bobo87b3o2$101bo$21b2o$22bo$20bo$18bo2bo48b2o$18b2o50bo$42b2o
28bo$40bo2bo27b2o$41bo55bo2bob2o94bo$39bo62bo2b2o90bobo$39b2o59bo2bo
92b2ob2o$74b2o23bobobo3bo89bob2o$75bo27bo7b2o80b2o4bo$73bo30bo6bo81bo
5bob2o$71bo2bo26b2obo8bo80bo6bo$71b2o28bobo2bo2b2ob2o77b2obo2bo5bo$89b
2o11bo2bob2obo80bobo2bo2b2ob2o$87bo2bo11bobo3bo83bo2bob2obo$88bo12bo2b
obo85bobo3bo$86bo16b2ob2o83bo2bobo$86b2o17bo87b2ob2o$195bo2$156b2o50b
2o$154bo2bo50bo2bo$155bo54bo$21b2o130bo58bo$21bo2bo128b2o56b2o$23bo$
25bo$24b2o10$119b2o$119bo$121bo$120bo2bo$122b2o$68b2o$68bo2bo$70bo$72b
o$71b2o3$74b2o$75bo$73bo$71bo2bo$71b2o$125b2o$123bo2bo$124bo$122bo$
122b2o66$' >>"$OUTFILE"
done
echo '!'>>"$OUTFILE"
exit 0


Example (001):

Code: Select all
x = 227, y = 476, rule = B2ce3ai/S1c23-a:T0,544
103b2o$103bo$105bo$104bo2bo$106b2o$32b2o$32bo2bo$34bo34b2o$36bo33bo$
35b2o31bo$66bo2bo123b2o$66b2o125bo$195bo$194bo2bo$196b2o10$75b2o$75bo
79bo$77bo10bo64b2ob2o60bo$76b2o8b2ob2o60bo2bobo59b2ob2o$84bo2bobo62bob
o3bo55bo2bobo$85bobo3bo60bo2bob2obo54bobo3bo$85bo2bob2obo57bobo2bo2b2o
b2o51bo2bob2obo$84bobo2bo2b2ob2o54b2obo8bo50bobo2bo2b2ob2o$84b2obo8bo
57bo6bo52b2obo8bo$86bo7bo58bobo5b2o53bo7bo$94b2o56b2ob2o67b2o$153bobo$
5b2o79b3o65bo61b3o$5bo2bo77bobo127bobo$7b2o77b3o127b3o$4b2o$5bo$3b2o$b
o2bo5b2o$b2o2bo4bo$o3bo3bobo$b3o2b2o6bo175b3o$bo3bo184bobo$3b2o2bo30b
2o30b2o31b2o30b2o31b2o20bobo7b2o$2bo2bo3bobo24bo2bo32bo28bo2bo32bo28bo
2bo20b3o9bo$10bo27b2o30b2o31b2o30b2o31b2o20bobo7b2o21b2o$190b3o30bo2bo
$100b3o87bobo32b2o$100bobo87b3o2$101bo$21b2o$22bo$20bo$18bo2bo48b2o$
18b2o50bo$42b2o28bo$40bo2bo27b2o$41bo55bo2bob2o94bo$39bo62bo2b2o90bobo
$39b2o59bo2bo92b2ob2o$74b2o23bobobo3bo89bob2o$75bo27bo7b2o80b2o4bo$73b
o30bo6bo81bo5bob2o$71bo2bo26b2obo8bo80bo6bo$71b2o28bobo2bo2b2ob2o77b2o
bo2bo5bo$89b2o11bo2bob2obo80bobo2bo2b2ob2o$87bo2bo11bobo3bo83bo2bob2ob
o$88bo12bo2bobo85bobo3bo$86bo16b2ob2o83bo2bobo$86b2o17bo87b2ob2o$195bo
2$156b2o50b2o$154bo2bo50bo2bo$155bo54bo$21b2o130bo58bo$21bo2bo128b2o
56b2o$23bo$25bo$24b2o10$119b2o$119bo$121bo$120bo2bo$122b2o$68b2o$68bo
2bo$70bo$72bo$71b2o3$74b2o$75bo$73bo$71bo2bo$71b2o$125b2o$123bo2bo$
124bo$122bo$122b2o65$103b2o$103bo$105bo$104bo2bo$106b2o$32b2o$32bo2bo$
34bo34b2o$36bo33bo$35b2o31bo$66bo2bo123b2o$66b2o125bo$195bo$194bo2bo$
196b2o10$75b2o$75bo79bo$77bo10bo64b2ob2o60bo$76b2o8b2ob2o60bo2bobo59b
2ob2o$84bo2bobo62bobo3bo55bo2bobo$85bobo3bo60bo2bob2obo54bobo3bo$85bo
2bob2obo57bobo2bo2b2ob2o51bo2bob2obo$84bobo2bo2b2ob2o54b2obo8bo50bobo
2bo2b2ob2o$84b2obo8bo57bo6bo52b2obo8bo$86bo7bo58bobo5b2o53bo7bo$94b2o
56b2ob2o67b2o$153bobo$5b2o79b3o65bo61b3o$5bo2bo77bobo127bobo$7b2o77b3o
127b3o$4b2o$5bo$3b2o$bo2bo5b2o$b2o2bo4bo$o3bo3bobo$b3o2b2o6bo175b3o$bo
3bo184bobo$3b2o2bo30b2o30b2o31b2o30b2o31b2o20bobo7b2o$2bo2bo3bobo24bo
2bo32bo28bo2bo32bo28bo2bo20b3o9bo$10bo27b2o30b2o31b2o30b2o31b2o20bobo
7b2o21b2o$190b3o30bo2bo$100b3o87bobo32b2o$100bobo87b3o2$101bo$21b2o$
22bo$20bo$18bo2bo48b2o$18b2o50bo$42b2o28bo$40bo2bo27b2o$41bo55bo2bob2o
94bo$39bo62bo2b2o90bobo$39b2o59bo2bo92b2ob2o$74b2o23bobobo3bo89bob2o$
75bo27bo7b2o80b2o4bo$73bo30bo6bo81bo5bob2o$71bo2bo26b2obo8bo80bo6bo$
71b2o28bobo2bo2b2ob2o77b2obo2bo5bo$89b2o11bo2bob2obo80bobo2bo2b2ob2o$
87bo2bo11bobo3bo83bo2bob2obo$88bo12bo2bobo85bobo3bo$86bo16b2ob2o83bo2b
obo$86b2o17bo87b2ob2o$195bo2$156b2o50b2o$154bo2bo50bo2bo$155bo54bo$21b
2o130bo58bo$21bo2bo128b2o56b2o$23bo$25bo$24b2o10$119b2o$119bo$121bo$
120bo2bo$122b2o$68b2o$68bo2bo$70bo$72bo$71b2o3$74b2o$75bo$73bo$71bo2bo
$71b2o$125b2o$123bo2bo$124bo$122bo$122b2o65$103b2o$103bo$105bo$104bo2b
o$106b2o$32b2o$32bo2bo$34bo34b2o$36bo33bo$35b2o31bo$66bo2bo123b2o$66b
2o125bo$195bo$194bo2bo$196b2o10$75b2o$75bo79bo$77bo10bo64b2ob2o60bo$
76b2o8b2ob2o60bo2bobo59b2ob2o$84bo2bobo62bobo3bo55bo2bobo$85bobo3bo60b
o2bob2obo54bobo3bo$85bo2bob2obo57bobo2bo2b2ob2o51bo2bob2obo$84bobo2bo
2b2ob2o54b2obo8bo50bobo2bo2b2ob2o$84b2obo8bo57bo6bo52b2obo8bo$86bo7bo
58bobo5b2o53bo7bo$94b2o56b2ob2o67b2o$153bobo$5b2o79b3o65bo61b3o$5bo2bo
77bobo127bobo$7b2o77b3o127b3o$4b2o$5bo$3b2o$bo2bo5b2o$b2o2bo4bo$o3bo3b
obo$b3o2b2o6bo175b3o$bo3bo184bobo$3b2o2bo30b2o63b2o30b2o31b2o20bobo7b
2o$2bo2bo3bobo24bo2bo61bo2bo32bo28bo2bo20b3o9bo$10bo27b2o63b2o30b2o31b
2o20bobo7b2o21b2o$190b3o30bo2bo$100b3o87bobo32b2o$100bobo87b3o2$101bo$
21b2o$22bo$20bo$18bo2bo48b2o$18b2o50bo$42b2o28bo$40bo2bo27b2o$41bo55bo
2bob2o94bo$39bo62bo2b2o90bobo$39b2o59bo2bo92b2ob2o$74b2o23bobobo3bo89b
ob2o$75bo27bo7b2o80b2o4bo$73bo30bo6bo81bo5bob2o$71bo2bo26b2obo8bo80bo
6bo$71b2o28bobo2bo2b2ob2o77b2obo2bo5bo$89b2o11bo2bob2obo80bobo2bo2b2ob
2o$87bo2bo11bobo3bo83bo2bob2obo$88bo12bo2bobo85bobo3bo$86bo16b2ob2o83b
o2bobo$86b2o17bo87b2ob2o$195bo2$156b2o50b2o$154bo2bo50bo2bo$155bo54bo$
21b2o130bo58bo$21bo2bo128b2o56b2o$23bo$25bo$24b2o10$119b2o$119bo$121bo
$120bo2bo$122b2o$68b2o$68bo2bo$70bo$72bo$71b2o3$74b2o$75bo$73bo$71bo2b
o$71b2o$125b2o$123bo2bo$124bo$122bo$122b2o!


[EDIT #1] possible bugfix in scriptfile.

[EDIT #2] 2017.10.15. possible bugS in viewer for looped surfaces, incremented height with 1 as a workaround.
Naszvadi
 
Posts: 273
Joined: May 7th, 2016, 8:53 am

Return to Scripts

Who is online

Users browsing this forum: No registered users and 1 guest