File: find_seed.bash

package info (click to toggle)
freecell-solver 3.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,332 kB
  • sloc: ansic: 29,493; perl: 8,911; xml: 5,162; python: 1,124; sh: 777; ruby: 358; cpp: 304; makefile: 150
file content (19 lines) | stat: -rw-r--r-- 460 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

seed=1

min_seed=""
min_num_times=10000000

while true; do

    num_times="$(pi-make-microsoft-freecell-board 12 | ./fc-solve --freecells-num 2 -to '[012][347]' --method random-dfs -seed "$seed" | grep -P '^Total number of states checked is' | grep -Po '\d+')"

    if test "$num_times" -lt "$min_num_times" ; then
        min_seed="$seed"
        min_num_times="$num_times"
    fi

    echo "min = $min_seed , $min_num_times"
    let seed++
done