genmovecode.sh (425B)
1 #!/bin/sh 2 3 gcc -DDEBUG h48_to_lst.c ../cube.c -o h48_to_lst 4 5 gen() { 6 for f in move_??_*.txt; do 7 move="$(echo $f | sed 's/.*_// ; s/\.txt//')" 8 lst="$(./h48_to_lst <$f)" 9 c="$(echo $lst | cut -d ' ' -f -8 | rev | cut -c 2- | rev)" 10 e="$(echo $lst | cut -d ' ' -f 9-)" 11 printf '[%s] = {\n' "$move" 12 printf '\t.corner = {%s},\n' "$c" 13 printf '\t.edge = {%s}\n' "$e" 14 printf '},\n' 15 done 16 } 17 18 gen 19 rm -f h48_to_lst invert