-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMilesBergner.java
More file actions
30 lines (28 loc) · 883 Bytes
/
MilesBergner.java
File metadata and controls
30 lines (28 loc) · 883 Bytes
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
/**
* Write a description of class MilesBergner here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class MilesBergner extends Player
{
public String getName() {
return "Miles Bergner";
}
protected boolean doesJoin(Game game, int c) {
if(points < 8) {
return c != 2;
} else {
Round[] rounds = game.getLastNumRounds(2).toArray(new Round[2]);
if(rounds[0].didEnterersWin() && rounds[1].didEnterersWin()) {
return true;
} else if (rounds[0].didEnterersWin() && !rounds[1].didEnterersWin()) {
return RAND.nextInt(3) != 0;
} else if (!rounds[0].didEnterersWin() && rounds[1].didEnterersWin()) {
return RAND.nextInt(3) == 0;
} else {
return false;
}
}
}
}