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 b35/s236

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

Made a Unit Cell grid creator for b35/s236

Postby Naszvadi » October 15th, 2017, 11:42 am

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#p52043
Misc. info about the rule here: ../forums/viewtopic.php?f=11&t=1921

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 B35/S236
#C Corollary: it is Turing-complete!
#C More info on this rule: http://www.ics.uci.edu/~eppstein/ca/b35s236/
x = 366, y = $((284*${#SPACE})), rule = B35/S236:T0,$((284*${#SPACE}))
END
for((I=0;I<${#SPACE};++I)); do
if ((${SPACE:I:1})); then
STATE=o26b
else
STATE=2o25b
fi
echo -n '6b2o$5b2o$6bo2bo$7b3o$8bo63b4o$71bo3bo$23bobo25b2o19bo4bo$22bo2b2o24b
3o19bo2b2o$23bobo25b2o2$2b3o$2bobo$2o2bo$o$3o2$76bo$76b2o$77bo$76bo$
79b2o$69b2o7bob2o$69b2o$69bo2$65b3o274b3o$65b2o275bo$187b2o153b2o2bo$
187b3o154bobo$344b3o$191bo$191b2o$191b2o2$340bo$339bobo$43bo295bob2o$
42bo294b2obo$41b2o293bo2bo$41b2o294b2o$47bo290bo$44b3o$44b2o10$334bobo
$334bo$333b2o20bo$333bo5bo14b3o2$75b3o259b3o14bobo$76bo259b2o17bo$77bo
$72bo3bo$72b2obo$72bobo5$198b2o$197b2o2bo$197bo3bo$197b4o$198bo4b2o70b
3o$112b2o88bo10b2o60b2o$111bo90bo2bo5b3obo60bo2bo$111b3o87b2ob2o5b2obo
62b3o$111bo90b3o8b2o63b2o4bo8bo$108b3o97b2o5bo67bobo6bo$107bobo98b2o
74bo6b2o$107bobo97b2obo72b3o4bobo$207bob2o78b3o$38bobo167bo2bo76bo$38b
2obo313bo$38bo3bo311bobo$43bo309bo3bo$42bo312bo$41b3o$62bo135bo135bo$
63bo24bobo25b2o25b3o24bobo26bo24bobo25b2o25b3o24bobo26bo29bo$61bo2bo
22bo2b2o24b3o22b5o23bob2o24bo2bo22bo2b2o24b3o22b5o23bob2o24bo2bo27b2o$
63bo24bobo25b'"$STATE"'3o24bobo26bo24bobo25b2o25b3o24bobo26bo28bo$37bo24bo
135bo135bo30bo$36b3o322b2o$36bo323b2obo$37b2o$33b2o2bo$32b2ob2o299bo$
33bobo299b3o$192bo148b3o$85b2o104bobo141bobo4bobo$86b2o248bo6b2o$83bo
2bo104b2o2bo148bo$83b3o107bo2bo133bo$84bo99bo8bobo133b3o$184bo143bo2bo
$185bo141b2o$184bo143b2o$180b2obo$182bo2$250bobo$249bo2bo$250bo2b2o2$
252bobo$253bo9b2o$262b3o$261bo2bo$260b2o$260b3o11$257bo$256bobo$257bo$
256b3o3$287b2o$287b2o$287bo$284b3o$284b2o7$299b2o$300b2o$297bo2bo$297b
3o$258b2o5b2o31bo$257b4o3b4o$256b3ob2ob2ob3o7bobo$54b2o201b4o3b4o8b2ob
o$53b2o203b2o5b2o9bobo$54bo2bo$55b3o$56bo235b3o$293bobo$294b2o$295bo
15$166b2o$168bo$166b3o$168bo$99b2o68b3o$100b3o67bobo$170bobo$96bo5bo$
96b2o$97bo$97bobo3$251bo$250bob2o$249bo$248bo$247bo4bo$246bo5bo$247bo
2b2o$247bo2$191b3o25b2o23b2o$191b5o22b3o23b2o$191b3o25b2o24bo$241bo2$
242b2o2bo$242b4obo$242b3obo$245b2o3b2o$245b3o$245b3o$249bo8$173b2o$
172b3o$173b2o$175b3o$175b3o$164bobo9bo$163bob2o$162bo3bo$161bo$162bo$
161b3o58$' >>"$OUTFILE"
done
echo '!'>>"$OUTFILE"
exit 0


Example (001) - each cell has period 1428 when it is on (and 68 in off state), height is 284:
#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 B35/S236
#C Corollary: it is Turing-complete!
#C More info on this rule: http://www.ics.uci.edu/~eppstein/ca/b35s236/
x = 366, y = 852, rule = B35/S236:T0,852
6b2o$5b2o$6bo2bo$7b3o$8bo63b4o$71bo3bo$23bobo25b2o19bo4bo$22bo2b2o24b
3o19bo2b2o$23bobo25b2o2$2b3o$2bobo$2o2bo$o$3o2$76bo$76b2o$77bo$76bo$
79b2o$69b2o7bob2o$69b2o$69bo2$65b3o274b3o$65b2o275bo$187b2o153b2o2bo$
187b3o154bobo$344b3o$191bo$191b2o$191b2o2$340bo$339bobo$43bo295bob2o$
42bo294b2obo$41b2o293bo2bo$41b2o294b2o$47bo290bo$44b3o$44b2o10$334bobo
$334bo$333b2o20bo$333bo5bo14b3o2$75b3o259b3o14bobo$76bo259b2o17bo$77bo
$72bo3bo$72b2obo$72bobo5$198b2o$197b2o2bo$197bo3bo$197b4o$198bo4b2o70b
3o$112b2o88bo10b2o60b2o$111bo90bo2bo5b3obo60bo2bo$111b3o87b2ob2o5b2obo
62b3o$111bo90b3o8b2o63b2o4bo8bo$108b3o97b2o5bo67bobo6bo$107bobo98b2o
74bo6b2o$107bobo97b2obo72b3o4bobo$207bob2o78b3o$38bobo167bo2bo76bo$38b
2obo313bo$38bo3bo311bobo$43bo309bo3bo$42bo312bo$41b3o$62bo135bo135bo$
63bo24bobo25b2o25b3o24bobo26bo24bobo25b2o25b3o24bobo26bo29bo$61bo2bo
22bo2b2o24b3o22b5o23bob2o24bo2bo22bo2b2o24b3o22b5o23bob2o24bo2bo27b2o$
63bo24bobo25b2o25b3o24bobo26bo24bobo25b2o25b3o24bobo26bo28bo$37bo24bo
135bo135bo30bo$36b3o322b2o$36bo323b2obo$37b2o$33b2o2bo$32b2ob2o299bo$
33bobo299b3o$192bo148b3o$85b2o104bobo141bobo4bobo$86b2o248bo6b2o$83bo
2bo104b2o2bo148bo$83b3o107bo2bo133bo$84bo99bo8bobo133b3o$184bo143bo2bo
$185bo141b2o$184bo143b2o$180b2obo$182bo2$250bobo$249bo2bo$250bo2b2o2$
252bobo$253bo9b2o$262b3o$261bo2bo$260b2o$260b3o11$257bo$256bobo$257bo$
256b3o3$287b2o$287b2o$287bo$284b3o$284b2o7$299b2o$300b2o$297bo2bo$297b
3o$258b2o5b2o31bo$257b4o3b4o$256b3ob2ob2ob3o7bobo$54b2o201b4o3b4o8b2ob
o$53b2o203b2o5b2o9bobo$54bo2bo$55b3o$56bo235b3o$293bobo$294b2o$295bo
15$166b2o$168bo$166b3o$168bo$99b2o68b3o$100b3o67bobo$170bobo$96bo5bo$
96b2o$97bo$97bobo3$251bo$250bob2o$249bo$248bo$247bo4bo$246bo5bo$247bo
2b2o$247bo2$191b3o25b2o23b2o$191b5o22b3o23b2o$191b3o25b2o24bo$241bo2$
242b2o2bo$242b4obo$242b3obo$245b2o3b2o$245b3o$245b3o$249bo8$173b2o$
172b3o$173b2o$175b3o$175b3o$164bobo9bo$163bob2o$162bo3bo$161bo$162bo$
161b3o58$6b2o$5b2o$6bo2bo$7b3o$8bo63b4o$71bo3bo$23bobo25b2o19bo4bo$22bo2b2o24b
3o19bo2b2o$23bobo25b2o2$2b3o$2bobo$2o2bo$o$3o2$76bo$76b2o$77bo$76bo$
79b2o$69b2o7bob2o$69b2o$69bo2$65b3o274b3o$65b2o275bo$187b2o153b2o2bo$
187b3o154bobo$344b3o$191bo$191b2o$191b2o2$340bo$339bobo$43bo295bob2o$
42bo294b2obo$41b2o293bo2bo$41b2o294b2o$47bo290bo$44b3o$44b2o10$334bobo
$334bo$333b2o20bo$333bo5bo14b3o2$75b3o259b3o14bobo$76bo259b2o17bo$77bo
$72bo3bo$72b2obo$72bobo5$198b2o$197b2o2bo$197bo3bo$197b4o$198bo4b2o70b
3o$112b2o88bo10b2o60b2o$111bo90bo2bo5b3obo60bo2bo$111b3o87b2ob2o5b2obo
62b3o$111bo90b3o8b2o63b2o4bo8bo$108b3o97b2o5bo67bobo6bo$107bobo98b2o
74bo6b2o$107bobo97b2obo72b3o4bobo$207bob2o78b3o$38bobo167bo2bo76bo$38b
2obo313bo$38bo3bo311bobo$43bo309bo3bo$42bo312bo$41b3o$62bo135bo135bo$
63bo24bobo25b2o25b3o24bobo26bo24bobo25b2o25b3o24bobo26bo29bo$61bo2bo
22bo2b2o24b3o22b5o23bob2o24bo2bo22bo2b2o24b3o22b5o23bob2o24bo2bo27b2o$
63bo24bobo25b2o25b3o24bobo26bo24bobo25b2o25b3o24bobo26bo28bo$37bo24bo
135bo135bo30bo$36b3o322b2o$36bo323b2obo$37b2o$33b2o2bo$32b2ob2o299bo$
33bobo299b3o$192bo148b3o$85b2o104bobo141bobo4bobo$86b2o248bo6b2o$83bo
2bo104b2o2bo148bo$83b3o107bo2bo133bo$84bo99bo8bobo133b3o$184bo143bo2bo
$185bo141b2o$184bo143b2o$180b2obo$182bo2$250bobo$249bo2bo$250bo2b2o2$
252bobo$253bo9b2o$262b3o$261bo2bo$260b2o$260b3o11$257bo$256bobo$257bo$
256b3o3$287b2o$287b2o$287bo$284b3o$284b2o7$299b2o$300b2o$297bo2bo$297b
3o$258b2o5b2o31bo$257b4o3b4o$256b3ob2ob2ob3o7bobo$54b2o201b4o3b4o8b2ob
o$53b2o203b2o5b2o9bobo$54bo2bo$55b3o$56bo235b3o$293bobo$294b2o$295bo
15$166b2o$168bo$166b3o$168bo$99b2o68b3o$100b3o67bobo$170bobo$96bo5bo$
96b2o$97bo$97bobo3$251bo$250bob2o$249bo$248bo$247bo4bo$246bo5bo$247bo
2b2o$247bo2$191b3o25b2o23b2o$191b5o22b3o23b2o$191b3o25b2o24bo$241bo2$
242b2o2bo$242b4obo$242b3obo$245b2o3b2o$245b3o$245b3o$249bo8$173b2o$
172b3o$173b2o$175b3o$175b3o$164bobo9bo$163bob2o$162bo3bo$161bo$162bo$
161b3o58$6b2o$5b2o$6bo2bo$7b3o$8bo63b4o$71bo3bo$23bobo25b2o19bo4bo$22bo2b2o24b
3o19bo2b2o$23bobo25b2o2$2b3o$2bobo$2o2bo$o$3o2$76bo$76b2o$77bo$76bo$
79b2o$69b2o7bob2o$69b2o$69bo2$65b3o274b3o$65b2o275bo$187b2o153b2o2bo$
187b3o154bobo$344b3o$191bo$191b2o$191b2o2$340bo$339bobo$43bo295bob2o$
42bo294b2obo$41b2o293bo2bo$41b2o294b2o$47bo290bo$44b3o$44b2o10$334bobo
$334bo$333b2o20bo$333bo5bo14b3o2$75b3o259b3o14bobo$76bo259b2o17bo$77bo
$72bo3bo$72b2obo$72bobo5$198b2o$197b2o2bo$197bo3bo$197b4o$198bo4b2o70b
3o$112b2o88bo10b2o60b2o$111bo90bo2bo5b3obo60bo2bo$111b3o87b2ob2o5b2obo
62b3o$111bo90b3o8b2o63b2o4bo8bo$108b3o97b2o5bo67bobo6bo$107bobo98b2o
74bo6b2o$107bobo97b2obo72b3o4bobo$207bob2o78b3o$38bobo167bo2bo76bo$38b
2obo313bo$38bo3bo311bobo$43bo309bo3bo$42bo312bo$41b3o$62bo135bo135bo$
63bo24bobo25b2o25b3o24bobo26bo24bobo25b2o25b3o24bobo26bo29bo$61bo2bo
22bo2b2o24b3o22b5o23bob2o24bo2bo22bo2b2o24b3o22b5o23bob2o24bo2bo27b2o$
63bo24bobo25bo26b3o24bobo26bo24bobo25b2o25b3o24bobo26bo28bo$37bo24bo
135bo135bo30bo$36b3o322b2o$36bo323b2obo$37b2o$33b2o2bo$32b2ob2o299bo$
33bobo299b3o$192bo148b3o$85b2o104bobo141bobo4bobo$86b2o248bo6b2o$83bo
2bo104b2o2bo148bo$83b3o107bo2bo133bo$84bo99bo8bobo133b3o$184bo143bo2bo
$185bo141b2o$184bo143b2o$180b2obo$182bo2$250bobo$249bo2bo$250bo2b2o2$
252bobo$253bo9b2o$262b3o$261bo2bo$260b2o$260b3o11$257bo$256bobo$257bo$
256b3o3$287b2o$287b2o$287bo$284b3o$284b2o7$299b2o$300b2o$297bo2bo$297b
3o$258b2o5b2o31bo$257b4o3b4o$256b3ob2ob2ob3o7bobo$54b2o201b4o3b4o8b2ob
o$53b2o203b2o5b2o9bobo$54bo2bo$55b3o$56bo235b3o$293bobo$294b2o$295bo
15$166b2o$168bo$166b3o$168bo$99b2o68b3o$100b3o67bobo$170bobo$96bo5bo$
96b2o$97bo$97bobo3$251bo$250bob2o$249bo$248bo$247bo4bo$246bo5bo$247bo
2b2o$247bo2$191b3o25b2o23b2o$191b5o22b3o23b2o$191b3o25b2o24bo$241bo2$
242b2o2bo$242b4obo$242b3obo$245b2o3b2o$245b3o$245b3o$249bo8$173b2o$
172b3o$173b2o$175b3o$175b3o$164bobo9bo$163bob2o$162bo3bo$161bo$162bo$
161b3o!
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