Files
sed110/run.sh
olemorud 533b991c0e 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.
2023-06-22 17:54:34 +02:00

13 lines
196 B
Bash
Executable File

#!/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