aboutsummaryrefslogtreecommitdiff
path: root/utils/gentransswitch.sh
blob: 42726ce7221eeed4879d68e65e681379953f65b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

printf '\tswitch (t) {\n'
for f in 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