1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/bin/sh printf '\tswitch (t) {\n' for f in cubes/transform_??_???.txt; do t="$(echo "$f" | sed 's/.*_// ; s/\.txt//')" mirror_or_rotation="$(echo "$t" | grep m)" if [ -z "$mirror_or_rotation" ]; then m="rotation" else m="mirrored" fi printf '\tcase %s:\n\t\treturn _trans_%s(%s, c);\n' "$t" "$m" "$t" done printf '\t}\n'
Generated with cgit - Back to sebastiano.tronto.net