diff options
Diffstat (limited to '')
| -rwxr-xr-x | utils/genmovecode.sh | 2 | ||||
| -rwxr-xr-x | utils/genmoveswitch.sh | 2 | ||||
| -rwxr-xr-x | utils/gentranscode.sh | 2 | ||||
| -rwxr-xr-x | utils/gentransswitch.sh | 4 | ||||
| -rwxr-xr-x | utils/gentranstests.sh | 8 |
5 files changed, 9 insertions, 9 deletions
diff --git a/utils/genmovecode.sh b/utils/genmovecode.sh index ddde0f7..cf13441 100755 --- a/utils/genmovecode.sh +++ b/utils/genmovecode.sh | |||
| @@ -4,7 +4,7 @@ cc -DDEBUG h48_to_lst.c ../src/nissy.c -o h48_to_lst | |||
| 4 | 4 | ||
| 5 | gen() { | 5 | gen() { |
| 6 | for f in cubes/move_??_*.txt; do | 6 | for f in cubes/move_??_*.txt; do |
| 7 | move="$(echo $f | sed 's/.*_// ; s/\.txt//')" | 7 | move="$(echo "$f" | sed 's/.*_// ; s/\.txt//')" |
| 8 | printf '#define _move_cube_%s fastcube( \\\n ' "$move" | 8 | printf '#define _move_cube_%s fastcube( \\\n ' "$move" |
| 9 | ./h48_to_lst <"$f" | 9 | ./h48_to_lst <"$f" |
| 10 | printf ')\n' | 10 | printf ')\n' |
diff --git a/utils/genmoveswitch.sh b/utils/genmoveswitch.sh index 4fe057c..3b2a74b 100755 --- a/utils/genmoveswitch.sh +++ b/utils/genmoveswitch.sh | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | printf '\tswitch (m) {\n' | 3 | printf '\tswitch (m) {\n' |
| 4 | for f in cubes/move_??_*.txt; do | 4 | for f in cubes/move_??_*.txt; do |
| 5 | t="$(echo $f | sed 's/.*_// ; s/\.txt//')" | 5 | t="$(echo "$f" | sed 's/.*_// ; s/\.txt//')" |
| 6 | printf '\tcase %s:\n\t\treturn _move(%s, c);\n' "$t" "$t" | 6 | printf '\tcase %s:\n\t\treturn _move(%s, c);\n' "$t" "$t" |
| 7 | done | 7 | done |
| 8 | printf '\t}\n' | 8 | printf '\t}\n' |
diff --git a/utils/gentranscode.sh b/utils/gentranscode.sh index e3e199e..9a1de2c 100755 --- a/utils/gentranscode.sh +++ b/utils/gentranscode.sh | |||
| @@ -10,7 +10,7 @@ sedsrc() { sed '3s/$/ };/ ; 3q'; } | |||
| 10 | 10 | ||
| 11 | gen() { | 11 | gen() { |
| 12 | for f in cubes/transform_??_???.txt; do | 12 | for f in cubes/transform_??_???.txt; do |
| 13 | trans="$(echo $f | sed 's/.*_// ; s/\.txt//')" | 13 | trans="$(echo "$f" | sed 's/.*_// ; s/\.txt//')" |
| 14 | printf '#define _trans_cube_%s fastcube( \\\n ' "$trans" | 14 | printf '#define _trans_cube_%s fastcube( \\\n ' "$trans" |
| 15 | ./h48_to_lst <"$f" | 15 | ./h48_to_lst <"$f" |
| 16 | printf ')\n' | 16 | printf ')\n' |
diff --git a/utils/gentransswitch.sh b/utils/gentransswitch.sh index 447c9be..20e2bfb 100755 --- a/utils/gentransswitch.sh +++ b/utils/gentransswitch.sh | |||
| @@ -2,8 +2,8 @@ | |||
| 2 | 2 | ||
| 3 | printf '\tswitch (t) {\n' | 3 | printf '\tswitch (t) {\n' |
| 4 | for f in cubes/transform_??_???.txt; do | 4 | for f in cubes/transform_??_???.txt; do |
| 5 | t="$(echo $f | sed 's/.*_// ; s/\.txt//')" | 5 | t="$(echo "$f" | sed 's/.*_// ; s/\.txt//')" |
| 6 | mirror_or_rotation="$(echo $t | grep m)" | 6 | mirror_or_rotation="$(echo "$t" | grep m)" |
| 7 | if [ -z "$mirror_or_rotation" ]; then | 7 | if [ -z "$mirror_or_rotation" ]; then |
| 8 | m="rotation" | 8 | m="rotation" |
| 9 | else | 9 | else |
diff --git a/utils/gentranstests.sh b/utils/gentranstests.sh index 62ebbda..a257a0a 100755 --- a/utils/gentranstests.sh +++ b/utils/gentranstests.sh | |||
| @@ -8,9 +8,9 @@ i=100 | |||
| 8 | while read -r line; do | 8 | while read -r line; do |
| 9 | [ -z "$line" ] && continue | 9 | [ -z "$line" ] && continue |
| 10 | 10 | ||
| 11 | trans_piece="$(echo $line | awk '{print $1}' | tr -d 'rm')" | 11 | trans_piece="$(echo "$line" | awk '{print $1}' | tr -d 'rm')" |
| 12 | move1="$(echo $line | awk '{print $2}')" | 12 | move1="$(echo "$line" | awk '{print $2}')" |
| 13 | move2="$(echo $line | awk '{print $3}')" | 13 | move2="$(echo "$line" | awk '{print $3}')" |
| 14 | 14 | ||
| 15 | rotation="rotation $trans_piece" | 15 | rotation="rotation $trans_piece" |
| 16 | 16 | ||
| @@ -23,7 +23,7 @@ while read -r line; do | |||
| 23 | i=$((i+1)) | 23 | i=$((i+1)) |
| 24 | 24 | ||
| 25 | mirrored="mirrored $trans_piece" | 25 | mirrored="mirrored $trans_piece" |
| 26 | move2m="$(echo ${move2} | tr 'LR' 'RL')3" | 26 | move2m="$(echo "${move2}" | tr 'LR' 'RL')3" |
| 27 | 27 | ||
| 28 | file1="$(ls cubes | grep "move_.*_${move1}.txt")" | 28 | file1="$(ls cubes | grep "move_.*_${move1}.txt")" |
| 29 | file2="$(ls cubes | grep "move_.*_${move2m}.txt")" | 29 | file2="$(ls cubes | grep "move_.*_${move2m}.txt")" |
