Skip to content

Instantly share code, notes, and snippets.

@trevren11
Last active November 7, 2017 18:31
Show Gist options
  • Save trevren11/2addec1e898b92fdab64956a67de9c04 to your computer and use it in GitHub Desktop.
Save trevren11/2addec1e898b92fdab64956a67de9c04 to your computer and use it in GitHub Desktop.
play.sh
#!/usr/bin/env bash
# cd ReversiServer; java Reversi 10; cd ..
# cd ReversiRandom_Java; java RandomGuy localhost 1; cd ..
# cd Ai; javac Ai.java; java Ai localhost 2 ; cd ..
# Linux commands
killall -9 java
cd server;
javac Player.java && javac Reversi.java && java Reversi 10 > ../output/server.log &
cd ..
sleep 1
echo 'Starting random player'
cd random;
javac RandomGuy.java && java RandomGuy localhost 1 > ../output/random.log &
cd ..
sleep 1
echo 'Compile and start AI'
cd ai;
# javac Ai.java && java Ai localhost 2 &
javac Ai.java && java Ai localhost 2 > ../output/ai.log &
cd ..
echo "Press any key to quit";
read input;
echo 'Killing java leftovers'
killall java
sleep 1
ps -a | grep java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment