Add run.sh

`run.sh` prints several iterations of rule 110 by running `rule110.sed`
in a loop. Additionally it formats the output to use ' ' for 0 and '#'
for space.
This commit is contained in:
olemorud
2023-06-22 17:36:01 +02:00
parent 89ceb12ff9
commit 533b991c0e

12
run.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
repeat=$(printf '%s' "$1" | wc -c)
next=$1
echo $next | tr '1' '#' | tr '0' ' '
for _ in `seq $repeat`; do
next=$(./rule110.sed <<<$next)
echo $next | tr '1' '#' | tr '0' ' '
done