aboutsummaryrefslogtreecommitdiff
path: root/utils/solvetest_gen.sh
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-07-31 08:38:37 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-07-31 08:38:37 +0200
commite2b154c40acaac4e7a7b3e379ada0404519c3750 (patch)
tree2ddca6533b03180eee1cd199d1c5a56586211a65 /utils/solvetest_gen.sh
parent36c317ebd1cf1dba8a8cbec494f4d3971e6cefd3 (diff)
downloadnissy-core-e2b154c40acaac4e7a7b3e379ada0404519c3750.tar.gz
nissy-core-e2b154c40acaac4e7a7b3e379ada0404519c3750.zip
Added solvetest for EO (broken for now)
Diffstat (limited to 'utils/solvetest_gen.sh')
-rwxr-xr-xutils/solvetest_gen.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/utils/solvetest_gen.sh b/utils/solvetest_gen.sh
new file mode 100755
index 0000000..c782ed8
--- /dev/null
+++ b/utils/solvetest_gen.sh
@@ -0,0 +1,23 @@
1#!/bin/sh
2
3args="$@"
4
5getsolutions() {
6 nissy solve -p $args "$1" |
7 while read -r solution; do
8 printf '\t\t"%s\\n"\n' "$solution"
9 done
10}
11
12printf "struct {\n\tchar *scramble;\n\tchar *solutions;\n} s[] = {\n"
13
14i=0
15while read -r scramble; do
16 solutions="$(getsolutions "$scramble")"
17 printf '[%s] = {\n\t.scramble = "%s",\n' "$i" "$scramble"
18 printf '\t.solutions =\n%s\n' "$solutions"
19 printf '},\n'
20 i=$((i+1))
21done
22
23printf "};\n"

Generated with cgit - Back to sebastiano.tronto.net