diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-31 08:38:37 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-31 08:38:37 +0200 |
| commit | e2b154c40acaac4e7a7b3e379ada0404519c3750 (patch) | |
| tree | 2ddca6533b03180eee1cd199d1c5a56586211a65 /utils | |
| parent | 36c317ebd1cf1dba8a8cbec494f4d3971e6cefd3 (diff) | |
| download | nissy-core-e2b154c40acaac4e7a7b3e379ada0404519c3750.tar.gz nissy-core-e2b154c40acaac4e7a7b3e379ada0404519c3750.zip | |
Added solvetest for EO (broken for now)
Diffstat (limited to 'utils')
| -rwxr-xr-x | utils/solvetest_gen.sh | 23 |
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 | |||
| 3 | args="$@" | ||
| 4 | |||
| 5 | getsolutions() { | ||
| 6 | nissy solve -p $args "$1" | | ||
| 7 | while read -r solution; do | ||
| 8 | printf '\t\t"%s\\n"\n' "$solution" | ||
| 9 | done | ||
| 10 | } | ||
| 11 | |||
| 12 | printf "struct {\n\tchar *scramble;\n\tchar *solutions;\n} s[] = {\n" | ||
| 13 | |||
| 14 | i=0 | ||
| 15 | while 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)) | ||
| 21 | done | ||
| 22 | |||
| 23 | printf "};\n" | ||
