forked from ccase/Cowboys
-
Notifications
You must be signed in to change notification settings - Fork 0
/
QuickTournament.java
31 lines (28 loc) · 1013 Bytes
/
QuickTournament.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.util.ArrayList;
import java.io.*;
public class QuickTournament {
ArrayList<Shooter> cowboys = new ArrayList<Shooter>();
public static void main(String args[]) {
int number_of_iterations = 10;
for (int i = 0; i < args.length; i++) {
// setting iterations
try {
number_of_iterations = Integer.parseInt(args[i]);
} catch (NumberFormatException e) {
// in case args[i] is not an int
}
}
FightClub fc = new FightClub("Tournament_Cowboys.txt");
int number_of_cowboys = fc.cowboys.size();
for (int n=0; n<number_of_iterations; n++) {
for (int i=0; i<number_of_cowboys; i++) {
for (int j=0; j<number_of_cowboys; j++) {
if (i != j) {
fc.fight(fc.cowboys.get(i),fc.cowboys.get(j),false);
}
}
}
}
fc.printStandings();
}
}