aboutsummaryrefslogtreecommitdiff
path: root/utils/genmovecode.sh
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-04-13 09:24:47 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-04-13 09:24:47 +0200
commitae055f1fc993d406939f57f11553d218e1efde82 (patch)
tree4a9e03d6eb9afc38cfd7e1735f7b70f17bdcf0d3 /utils/genmovecode.sh
parent72e018b066bd5cc3ce0181b43865a227e8b9b6ec (diff)
downloadcubecore-ae055f1fc993d406939f57f11553d218e1efde82.tar.gz
cubecore-ae055f1fc993d406939f57f11553d218e1efde82.zip
Simplified moves and trans
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