Skip to content

Instantly share code, notes, and snippets.

@tmarble
Created November 15, 2018 03:10
Show Gist options
  • Save tmarble/7c8c610a26695725ccd3e43472b74821 to your computer and use it in GitHub Desktop.
Save tmarble/7c8c610a26695725ccd3e43472b74821 to your computer and use it in GitHub Desktop.
run_game2.sh
#!/bin/sh
set -e
jar="target/MyBot.jar"
if [ ! -e "$jar" ]; then
echo "Building uberjar..."
lein uberjar
else
echo "uberjar up to date..."
fi
seed=166518260
bot0="java -jar $jar $seed"
bot1=$bot0
timestamp=$(date +%Y-%m-%d_%H:%M:%S)
if [ -d "$timestamp" ]; then
echo "Log directory $timestamp already exists"
exit 1
fi
mkdir "$timestamp"
./halite --replay-directory "$timestamp" --width 32 --height 32 --seed $seed "$bot0" "$bot1"
mv bot-*.log "$timestamp"
echo "Saved logs in $timestamp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment