aboutsummaryrefslogtreecommitdiff
path: root/old/moves_trans
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-11-19 10:40:49 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2023-11-19 10:40:49 +0100
commit13275a4bb8696e730a4fffdd05b8e1d046e489c6 (patch)
tree4db3ed3ada41158c451188c98e74fdde5ea296b2 /old/moves_trans
parentd6fdf14d5c320bdca455f910d58d652c5a7827da (diff)
downloadnissy-core-13275a4bb8696e730a4fffdd05b8e1d046e489c6.tar.gz
nissy-core-13275a4bb8696e730a4fffdd05b8e1d046e489c6.zip
Simplified cube definition for move and transformations even more
Diffstat (limited to 'old/moves_trans')
-rwxr-xr-xold/moves_trans/v2/genmovecode.sh21
-rwxr-xr-xold/moves_trans/v2/gentranscode.sh24
2 files changed, 45 insertions, 0 deletions
diff --git a/old/moves_trans/v2/genmovecode.sh b/old/moves_trans/v2/genmovecode.sh
new file mode 100755
index 0000000..9d5fa7a
--- /dev/null
+++ b/old/moves_trans/v2/genmovecode.sh
@@ -0,0 +1,21 @@
1#!/bin/sh
2
3type="${1:-src}"
4
5gcc -DDEBUG h48_to_"$type".c ../cube.c -o h48_to_"$type"
6
7lineavx() { printf '#define _move_cube_%s ' "$1"; }
8linesrc() { printf '_static cube_fast_t _move_cube_%s = ' "$1"; }
9sedavx() { sed '1,2s/$/ \\/ ; 3s/$/)/ ; 3q'; }
10sedsrc() { sed '3s/$/ };/ ; 3q'; }
11
12gen() {
13 for f in move_??_*.txt; do
14 move="$(echo $f | sed 's/.*_// ; s/\.txt//')"
15 line$type "$move"
16 ./h48_to_"$type" <"$f" | sed$type
17 done
18}
19
20gen
21rm -f h48_to_"$type" invert
diff --git a/old/moves_trans/v2/gentranscode.sh b/old/moves_trans/v2/gentranscode.sh
new file mode 100755
index 0000000..b9d41b6
--- /dev/null
+++ b/old/moves_trans/v2/gentranscode.sh
@@ -0,0 +1,24 @@
1#!/bin/sh
2
3type="${1:-src}"
4
5gcc -DDEBUG h48_to_"$type".c ../cube.c -o h48_to_"$type"
6gcc -DDEBUG invert.c ../cube.c -o invert
7
8lineavx() { printf '#define _trans_cube_%s ' "$1"; }
9linesrc() { printf '_static cube_fast_t _trans_cube_%s = ' "$1"; }
10sedavx() { sed '1,2s/$/ \\/ ; 3s/$/)/ ; 3q'; }
11sedsrc() { sed '3s/$/ };/ ; 3q'; }
12
13gen() {
14 for f in transform_??_???.txt; do
15 trans="$(echo $f | sed 's/.*_// ; s/\.txt//')"
16 line$type "$trans"
17 ./h48_to_"$type" <"$f" | sed$type
18 line$type "${trans}_inverse"
19 ./invert <"$f" | ./h48_to_"$type" | sed$type
20 done
21}
22
23gen
24rm -f h48_to_"$type" invert

Generated with cgit - Back to sebastiano.tronto.net