2010-07-14 16:39:06 -06:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
if [ -f next-round ]; then
|
|
|
|
next=$(cat next-round)
|
|
|
|
else
|
|
|
|
next=0
|
|
|
|
fi
|
|
|
|
expr $next + 1 > next-round
|
|
|
|
|
|
|
|
fn=$(printf "round-%04d.html" $next)
|
2010-07-20 12:06:33 -06:00
|
|
|
rfn=results$$.txt
|
2010-07-14 16:39:06 -06:00
|
|
|
|
|
|
|
|
|
|
|
echo -n "Running round $next... "
|
2010-07-20 12:06:33 -06:00
|
|
|
cat <<EOF >$fn
|
2010-07-14 16:39:06 -06:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Tanks Round $next</title>
|
|
|
|
<script type="application/javascript" src="tanks.js"></script>
|
2010-07-20 12:06:33 -06:00
|
|
|
<link rel="stylesheet" href="tanks.css" type="text/css">
|
2010-07-14 16:39:06 -06:00
|
|
|
<script type="application/javascript">
|
|
|
|
function go() {
|
2010-07-20 15:39:10 -06:00
|
|
|
start("battlefield",
|
2010-07-14 16:39:06 -06:00
|
|
|
// Start JSON data
|
|
|
|
EOF
|
2010-07-20 12:06:33 -06:00
|
|
|
./run-tanks players/* >>$fn 3>$rfn
|
|
|
|
cat <<EOF >>$fn
|
2010-07-14 16:39:06 -06:00
|
|
|
// end JSON data
|
|
|
|
);
|
|
|
|
}
|
|
|
|
window.onload = go;
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="game_box"><canvas id="battlefield"></canvas></div>
|
|
|
|
<p><span id="fps">0</span> fps</p>
|
2010-07-20 12:06:33 -06:00
|
|
|
EOF
|
|
|
|
./rank.awk $rfn >>$fn
|
|
|
|
rm -f $rfn
|
|
|
|
cat <<EOF >>$fn
|
2010-07-14 16:39:06 -06:00
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
EOF
|
2010-07-20 12:06:33 -06:00
|
|
|
|
|
|
|
./summary.awk > summary.html
|
|
|
|
|
2010-07-14 16:39:06 -06:00
|
|
|
echo "done."
|
|
|
|
|