h48

A prototype for an optimal Rubik's cube solver, work in progress.
git clone https://git.tronto.net/h48
Download | Log | Files | Refs | README | LICENSE

run_tool.sh (487B)


      1 #!/bin/sh
      2 
      3 if [ -z "$TOOL" ]; then
      4 	echo "No tool selected (TOOL variable must be set)"
      5 	exit 1
      6 fi
      7 
      8 CC="$CC -D_POSIX_C_SOURCE=199309L"
      9 
     10 BIN="tools/run"
     11 d="$(date +'%Y-%m-%d-%H-%M-%S')"
     12 
     13 for t in tools/*; do
     14 	if [ ! -d "$t" ] || [ -z "$(echo "$t" | grep "$TOOL")" ]; then
     15 		continue
     16 	fi
     17 	toolname="$(basename "$t" .c)"
     18 	$CC -o $BIN $t/*.c $CUBEOBJ || exit 1;
     19 	$BIN | tee "tools/results/$toolname-$d.txt"
     20 	break
     21 done
     22 
     23 # $BIN is kept so it can be run manually for profiling
     24 rm -rf $CUBEOBJ