-
Notifications
You must be signed in to change notification settings - Fork 0
/
Harvey.java
44 lines (39 loc) · 879 Bytes
/
Harvey.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
32
33
34
35
36
37
38
39
40
41
42
43
44
import java.util.ArrayList;
public class Harvey extends AI {
public Harvey(Space [] board, Colour colour)
{
super(board, colour);
}
public int getScore(Move move)
{
int type = 0;
switch(move.getType())
{
case BEAROFF: type = 90;
break;
case CAPTURE: type = 50;
break;
case NORMAL: type = 20;
break;
}
int protect;
if (board[move.getStart()].getNumCounters() -1 == 0)
{
protect = 10;
}
else if (board[move.getStart()].getNumCounters() -1 == 1)
{
protect = 0;
}
else
{
protect = 5;
}
int score = type + protect;
return score;
}
public String toString()
{
return "Harvey";
}
}