Last active
December 15, 2015 18:59
-
-
Save hc5/5307686 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(int i = 0;i<1000;i++){ | |
ServerSocket ss = new ServerSocket(8123); | |
OddBoard b = new OddBoard(); | |
Thread s = new Thread(new Server(b, false, true, ss, 5000)); | |
s.start(); | |
c = new Thread(new Client(new AIPlayer(),"localhost",8123)); | |
c1 = new Thread(new Client(new OddRandomPlayer(),"localhost",8123)); | |
ArrayList<Thread> clients = new ArrayList<>(); | |
clients.add(c); | |
clients.add(c1); | |
Collections.shuffle(clients); | |
clients.get(0).start(); | |
Thread.sleep(500); | |
clients.get(1).start(); | |
s.join(); | |
clients.get(0).join(); | |
clients.get(1).join(); | |
ss.close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment