aboutsummaryrefslogtreecommitdiff
path: root/utils/genmovecode.sh
diff options
context:
space:
mode:
Diffstat (limited to 'utils/genmovecode.sh')
-rwxr-xr-xutils/genmovecode.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/utils/genmovecode.sh b/utils/genmovecode.sh
new file mode 100755
index 0000000..25ad039
--- /dev/null
+++ b/utils/genmovecode.sh
@@ -0,0 +1,19 @@
1#!/bin/sh
2
3gcc -DDEBUG h48_to_lst.c ../cube.c -o h48_to_lst
4
5gen() {
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
18gen
19rm -f h48_to_lst invert

Generated with cgit - Back to sebastiano.tronto.net