blob: 2fd5dd3c0da65a461368db7668a37c1e0ee341c3 (
plain)
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
45
46
47
48
49
50
|
package ch.epfl.maze.physical.zoo;
import ch.epfl.maze.physical.Animal;
import ch.epfl.maze.util.Direction;
import ch.epfl.maze.util.Vector2D;
import java.util.Set;
/**
* Space Invader A.I. that implements an algorithm of your choice.
* <p>
* Note that this class is considered as a <i>bonus</i>, meaning that you do not
* have to implement it (see statement: section 6, Extensions libres).
* <p>
* If you consider implementing it, you will have bonus points on your grade if
* it can exit a simply-connected maze, plus additional points if it is more
* efficient than the animals you had to implement.
* <p>
* The way we measure efficiency is made by the test case {@code Competition}.
*
* @author EPFL
* @see ch.epfl.maze.tests.Competition Competition
*/
public class SpaceInvader extends Animal {
/**
* Constructs a space invader with a starting position.
*
* @param position Starting position of the mouse in the labyrinth
*/
public SpaceInvader(Vector2D position) {
super(position);
// TODO (bonus)
}
/**
* Moves according to (... please complete with as many details as you can).
*/
@Override
public Direction move(Set<Direction> choices) {
// TODO (bonus)
return Direction.NONE;
}
@Override
public Animal copy() {
return new SpaceInvader(this.getPosition());
}
}
|