Still tweaking the scoring scripts.

This commit is contained in:
Mike Pope 2015-05-16 12:28:09 +09:30
parent a5a5a44388
commit d06d3e2449
2 changed files with 7 additions and 7 deletions

View File

@ -31,7 +31,7 @@ blockit () {
}
section () {
printf "%-15s" "$1"
printf "%-16s" "$1"
}
statit () {
@ -43,7 +43,7 @@ statit () {
tmp=`mktemp btan.XXXXXXXX`
trap "rm -f '$tmp'" 0
cat - > "$tmp"
runs=`sed -n -e 's/^run: .*colonies: n=\([0-9]*\) mean=\([\.0-9]*\) sd=\([\.0-9]*\), buildings: \([0-9]*\), euroExpense: \([-0-9]*\), euroIncome: \([0-9]*\)$/NC="\1";MEAN="\2";SD="\3";NB="\4";EE="\5";EI="\6"/p' "$tmp"`
runs=`sed -n -e 's/^run: .*colonies: n=\([0-9]*\) mean=\([\.0-9]*\) sd=\([\.0-9]*\), buildings: \([0-9]*\), euroExpense: \([0-9]*\), euroIncome: \([0-9]*\)$/NC="\1";MEAN="\2";SD="\3";NB="\4";EE="\5";EI="\6"/p' "$tmp"`
N=0
for r in $runs ; do N=`expr $N + 1`; done
@ -74,6 +74,10 @@ section "SettlementFalls"
sed -n -e 's/^Count native-fall: *\(.*\)$/\1/p' "$tmp" | statit
blockit
section "Cashins"
sed -n -e 's/^Count cashins: *\(.*\)$/\1/p' "$tmp" | statit
blockit
section "Cibola Finds"
sed -n -e 's/^Count Cibola: *\(.*\)$/\1/p' "$tmp" | statit
blockit
@ -90,10 +94,6 @@ section "Fountain Finds"
sed -n -e 's/^Count fountain: *\(.*\)$/\1/p' "$tmp" | statit
blockit
section "Cashins"
sed -n -e 's/^Count cashins: *\(.*\)$/\1/p' "$tmp" | statit
blockit
section "Defences"
sed -n -e 's/^Count defences: *\(.*\)$/\1/p' "$tmp" | statit
blockit

View File

@ -30,7 +30,7 @@ for f in ${1+"$@"} ; do
echo -n "colonies: $colonies, buildings: $buildings"
xml_grep 'marketData' "$b/savegame.xml" \
| sed -e 's/^.*incomeAfterTaxes="\([^"]*\)".*$/\1/' \
| awk '{ if ($1 < 0) l += $1; if ($1 > 0) u += $1; } END { printf(", euroExpense: %d, euroIncome: %d\n", l, u); }'
| awk '{ if ($1 < 0) l += $1; if ($1 > 0) u += $1; } END { printf(", euroExpense: %d, euroIncome: %d\n", -l, u); }'
xml_grep 'player' "$b/savegame.xml" \
| sed -n -e '/playerType="NATIVE"/d' -e '/playerType="REF"/d' \
-e '/playerType="native"/d' -e '/playerType="ref"/d' \