-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTeamMain.java
More file actions
40 lines (29 loc) · 1.31 KB
/
TeamMain.java
File metadata and controls
40 lines (29 loc) · 1.31 KB
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
32
33
34
35
36
37
38
39
40
package battlehub;
import battleship.core.*;
import battleship.games.*;
import battleship.ships.*;
import java.util.*;
public class TeamMain {
public static void main(String[] args) {
int seed = (int) Math.floor(Math.random() * 100);
if (args.length >= 1) {
seed = Integer.parseInt(args[0]);
}
System.out.println("Seed: " + seed);
List<TeamBattle.Loyalty> c = new ArrayList<TeamBattle.Loyalty>();
// Team A
c.add(new TeamBattle.Loyalty(battleship.ships.DummyShip.class, "Team B"));
c.add(new TeamBattle.Loyalty(battleship.ships.DummyShip.class, "Team B"));
c.add(new TeamBattle.Loyalty(battleship.ships.DummyShip.class, "Team B"));
// Team B
c.add(new TeamBattle.Loyalty(battleship.ships.DummyShip.class, "Team B"));
c.add(new TeamBattle.Loyalty(battleship.ships.DummyShip.class, "Team B"));
c.add(new TeamBattle.Loyalty(battleship.ships.DummyShip.class, "Team B"));
TeamBattle battle = new TeamBattle(c, seed);
battle.setMaxTurns(100);
battle.setArenaFile("files/team-arena.txt");
battle.setTurnFile("files/team-turns.txt");
battle.setLogFile("files/team-log.txt");
battle.run();
}
}