From d06d3e24497de583549300f3eb525de5b18c21a7 Mon Sep 17 00:00:00 2001 From: Mike Pope Date: Sat, 16 May 2015 12:28:09 +0930 Subject: [PATCH] Still tweaking the scoring scripts. --- bin/btan.sh | 12 ++++++------ bin/fsgscore.sh | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/btan.sh b/bin/btan.sh index f9ceb710e..d7318127d 100755 --- a/bin/btan.sh +++ b/bin/btan.sh @@ -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 diff --git a/bin/fsgscore.sh b/bin/fsgscore.sh index 45469ca3c..88ae979d9 100755 --- a/bin/fsgscore.sh +++ b/bin/fsgscore.sh @@ -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' \