#! /bin/sh if [ "$#" -gt 0 ]; then tanks="$@" else echo "Usage: $0 tank1 tank2 [...]" echo "Writes ./next-round and ./summary.html" exit 1 fi TANKS_GAME=${TANKS_GAME:-forftanks} NAV_HTML_INC=${NAV_HTML_INC:-./nav.html.inc} export NAV_HTML_INC # Add wherever this lives to the search path PATH=$PATH:$(dirname $0) if [ -f next-round ]; then next=$(cat next-round) else next=0 fi expr $next + 1 > next-round fn=$(printf "round-%04d.html" $next) rfn=results$$.txt # Clean up old games ofn=$(printf "round-%04d.html" $(expr $next - 720)) echo "Removing $ofn" rm -f $ofn echo -n "Running round $next... " cat <$fn Tanks Round $next

Tanks Round $next

0 fps

EOF rank.awk $rfn >>$fn rm -f $rfn cat $NAV_HTML_INC >>$fn cat <>$fn EOF summary.awk $tanks > summary.html.$$ mv summary.html.$$ summary.html echo "done."