diff options
Diffstat (limited to 'src/ch/epfl/maze/physical/zoo/Bear.java')
-rw-r--r-- | src/ch/epfl/maze/physical/zoo/Bear.java | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/src/ch/epfl/maze/physical/zoo/Bear.java b/src/ch/epfl/maze/physical/zoo/Bear.java index 1a75932..5cccc08 100644 --- a/src/ch/epfl/maze/physical/zoo/Bear.java +++ b/src/ch/epfl/maze/physical/zoo/Bear.java | |||
@@ -6,41 +6,39 @@ import ch.epfl.maze.util.Vector2D; | |||
6 | 6 | ||
7 | /** | 7 | /** |
8 | * Bear A.I. that implements the Pledge Algorithm. | 8 | * Bear A.I. that implements the Pledge Algorithm. |
9 | * | ||
10 | */ | 9 | */ |
11 | 10 | ||
12 | public class Bear extends Animal { | 11 | public class Bear extends Animal { |
13 | 12 | ||
14 | /** | 13 | /** |
15 | * Constructs a bear with a starting position. | 14 | * Constructs a bear with a starting position. |
16 | * | 15 | * |
17 | * @param position | 16 | * @param position Starting position of the bear in the labyrinth |
18 | * Starting position of the bear in the labyrinth | 17 | */ |
19 | */ | 18 | |
20 | 19 | public Bear(Vector2D position) { | |
21 | public Bear(Vector2D position) { | 20 | super(position); |
22 | super(position); | 21 | // TODO |
23 | // TODO | 22 | } |
24 | } | 23 | |
25 | 24 | /** | |
26 | /** | 25 | * Moves according to the <i>Pledge Algorithm</i> : the bear tries to move |
27 | * Moves according to the <i>Pledge Algorithm</i> : the bear tries to move | 26 | * towards a favorite direction until it hits a wall. In this case, it will |
28 | * towards a favorite direction until it hits a wall. In this case, it will | 27 | * turn right, put its paw on the left wall, count the number of times it |
29 | * turn right, put its paw on the left wall, count the number of times it | 28 | * turns right, and subtract to this the number of times it turns left. It |
30 | * turns right, and subtract to this the number of times it turns left. It | 29 | * will repeat the procedure when the counter comes to zero, or until it |
31 | * will repeat the procedure when the counter comes to zero, or until it | 30 | * leaves the maze. |
32 | * leaves the maze. | 31 | */ |
33 | */ | 32 | |
34 | 33 | @Override | |
35 | @Override | 34 | public Direction move(Direction[] choices) { |
36 | public Direction move(Direction[] choices) { | 35 | // TODO |
37 | // TODO | 36 | return Direction.NONE; |
38 | return Direction.NONE; | 37 | } |
39 | } | 38 | |
40 | 39 | @Override | |
41 | @Override | 40 | public Animal copy() { |
42 | public Animal copy() { | 41 | // TODO |
43 | // TODO | 42 | return null; |
44 | return null; | 43 | } |
45 | } | ||
46 | } | 44 | } |