2 # Simple script using Pachi for rating all moves in a given situation.
3 # Pachi will analyse each followup move and suggest a winrate for it;
6 # Usage: tools/sgf-ratemove.sh SGF MOVENUM PACHIARGS...
8 # Note that this script assumes dynkomi=none and does not show
9 # dynamic komi information. (Would be trivial to add but it's tricky
10 # to interpret the data.)
12 # This script is dirty and insecure for untrusted input!
14 # Example: tools/sgf-ratemove.sh progame.sgf 120 -t =500 -d 0
15 # ...to get 500 simulations per each possible move in programe.sgf
18 # If you want to know more details on what is Pachi thinking about the
19 # various moves, remove the `-d 0` part. To improve the accuracy of values
20 # (at the expense of run time), raise the value of 500 (try 2000 or 10000;
21 # 100000 will usually already take couple of hours). The values will be
22 # most useful in the middle game; in fuseki and most yose situations,
23 # expect a lot of noise.
27 tools
/sgf2gtp.pl
-g -n $movenum <"$sgf" |
28 sed -e 's/genmove/0 pachi-evaluate/' |
30 sed -ne '/^=0/,${s/^=0 //;p}' |