genmoveswitch.sh (193B)
1 #!/bin/sh 2 3 printf '\tswitch (m) {\n' 4 for f in cubes/move_??_*.txt; do 5 t="$(echo $f | sed 's/.*_// ; s/\.txt//')" 6 printf '\tcase %s:\n\t\treturn _move(%s, c);\n' "$t" "$t" 7 done 8 printf '\t}\n'
![]() | h48A prototype for an optimal Rubik's cube solver, work in progress. |
git clone https://git.tronto.net/h48 | |
Download | Log | Files | Refs | README | LICENSE |
genmoveswitch.sh (193B)
1 #!/bin/sh 2 3 printf '\tswitch (m) {\n' 4 for f in cubes/move_??_*.txt; do 5 t="$(echo $f | sed 's/.*_// ; s/\.txt//')" 6 printf '\tcase %s:\n\t\treturn _move(%s, c);\n' "$t" "$t" 7 done 8 printf '\t}\n'