From 90bd766f361083f6fd9e39ff080c83fcc606832f Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Sat, 21 Nov 2015 10:44:42 +0100 Subject: Reformat imported code --- src/ch/epfl/maze/physical/zoo/Bear.java | 64 ++++++++++++------------- src/ch/epfl/maze/physical/zoo/Hamster.java | 56 +++++++++++----------- src/ch/epfl/maze/physical/zoo/Monkey.java | 54 ++++++++++----------- src/ch/epfl/maze/physical/zoo/Mouse.java | 54 ++++++++++----------- src/ch/epfl/maze/physical/zoo/Panda.java | 52 ++++++++++---------- src/ch/epfl/maze/physical/zoo/SpaceInvader.java | 58 +++++++++++----------- 6 files changed, 163 insertions(+), 175 deletions(-) (limited to 'src/ch/epfl/maze/physical/zoo') 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; /** * Bear A.I. that implements the Pledge Algorithm. - * */ public class Bear extends Animal { - /** - * Constructs a bear with a starting position. - * - * @param position - * Starting position of the bear in the labyrinth - */ - - public Bear(Vector2D position) { - super(position); - // TODO - } - - /** - * Moves according to the Pledge Algorithm : the bear tries to move - * towards a favorite direction until it hits a wall. In this case, it will - * turn right, put its paw on the left wall, count the number of times it - * turns right, and subtract to this the number of times it turns left. It - * will repeat the procedure when the counter comes to zero, or until it - * leaves the maze. - */ - - @Override - public Direction move(Direction[] choices) { - // TODO - return Direction.NONE; - } - - @Override - public Animal copy() { - // TODO - return null; - } + /** + * Constructs a bear with a starting position. + * + * @param position Starting position of the bear in the labyrinth + */ + + public Bear(Vector2D position) { + super(position); + // TODO + } + + /** + * Moves according to the Pledge Algorithm : the bear tries to move + * towards a favorite direction until it hits a wall. In this case, it will + * turn right, put its paw on the left wall, count the number of times it + * turns right, and subtract to this the number of times it turns left. It + * will repeat the procedure when the counter comes to zero, or until it + * leaves the maze. + */ + + @Override + public Direction move(Direction[] choices) { + // TODO + return Direction.NONE; + } + + @Override + public Animal copy() { + // TODO + return null; + } } diff --git a/src/ch/epfl/maze/physical/zoo/Hamster.java b/src/ch/epfl/maze/physical/zoo/Hamster.java index a000daf..2a610f2 100644 --- a/src/ch/epfl/maze/physical/zoo/Hamster.java +++ b/src/ch/epfl/maze/physical/zoo/Hamster.java @@ -7,37 +7,35 @@ import ch.epfl.maze.util.Vector2D; /** * Hamster A.I. that remembers the previous choice it has made and the dead ends * it has already met. - * */ public class Hamster extends Animal { - /** - * Constructs a hamster with a starting position. - * - * @param position - * Starting position of the hamster in the labyrinth - */ - - public Hamster(Vector2D position) { - super(position); - // TODO - } - - /** - * Moves without retracing directly its steps and by avoiding the dead-ends - * it learns during its journey. - */ - - @Override - public Direction move(Direction[] choices) { - // TODO - return Direction.NONE; - } - - @Override - public Animal copy() { - // TODO - return null; - } + /** + * Constructs a hamster with a starting position. + * + * @param position Starting position of the hamster in the labyrinth + */ + + public Hamster(Vector2D position) { + super(position); + // TODO + } + + /** + * Moves without retracing directly its steps and by avoiding the dead-ends + * it learns during its journey. + */ + + @Override + public Direction move(Direction[] choices) { + // TODO + return Direction.NONE; + } + + @Override + public Animal copy() { + // TODO + return null; + } } diff --git a/src/ch/epfl/maze/physical/zoo/Monkey.java b/src/ch/epfl/maze/physical/zoo/Monkey.java index a9295b8..f0f9b2e 100644 --- a/src/ch/epfl/maze/physical/zoo/Monkey.java +++ b/src/ch/epfl/maze/physical/zoo/Monkey.java @@ -6,36 +6,34 @@ import ch.epfl.maze.util.Vector2D; /** * Monkey A.I. that puts its hand on the left wall and follows it. - * */ public class Monkey extends Animal { - /** - * Constructs a monkey with a starting position. - * - * @param position - * Starting position of the monkey in the labyrinth - */ - - public Monkey(Vector2D position) { - super(position); - // TODO - } - - /** - * Moves according to the relative left wall that the monkey has to follow. - */ - - @Override - public Direction move(Direction[] choices) { - // TODO - return Direction.NONE; - } - - @Override - public Animal copy() { - // TODO - return null; - } + /** + * Constructs a monkey with a starting position. + * + * @param position Starting position of the monkey in the labyrinth + */ + + public Monkey(Vector2D position) { + super(position); + // TODO + } + + /** + * Moves according to the relative left wall that the monkey has to follow. + */ + + @Override + public Direction move(Direction[] choices) { + // TODO + return Direction.NONE; + } + + @Override + public Animal copy() { + // TODO + return null; + } } diff --git a/src/ch/epfl/maze/physical/zoo/Mouse.java b/src/ch/epfl/maze/physical/zoo/Mouse.java index 17d8b5c..e5cb9ae 100644 --- a/src/ch/epfl/maze/physical/zoo/Mouse.java +++ b/src/ch/epfl/maze/physical/zoo/Mouse.java @@ -6,36 +6,34 @@ import ch.epfl.maze.util.Vector2D; /** * Mouse A.I. that remembers only the previous choice it has made. - * */ public class Mouse extends Animal { - /** - * Constructs a mouse with a starting position. - * - * @param position - * Starting position of the mouse in the labyrinth - */ - - public Mouse(Vector2D position) { - super(position); - } - - /** - * Moves according to an improved version of a random walk : the - * mouse does not directly retrace its steps. - */ - - @Override - public Direction move(Direction[] choices) { - // TODO - return Direction.NONE; - } - - @Override - public Animal copy() { - // TODO - return null; - } + /** + * Constructs a mouse with a starting position. + * + * @param position Starting position of the mouse in the labyrinth + */ + + public Mouse(Vector2D position) { + super(position); + } + + /** + * Moves according to an improved version of a random walk : the + * mouse does not directly retrace its steps. + */ + + @Override + public Direction move(Direction[] choices) { + // TODO + return Direction.NONE; + } + + @Override + public Animal copy() { + // TODO + return null; + } } diff --git a/src/ch/epfl/maze/physical/zoo/Panda.java b/src/ch/epfl/maze/physical/zoo/Panda.java index 73c7194..c168d97 100644 --- a/src/ch/epfl/maze/physical/zoo/Panda.java +++ b/src/ch/epfl/maze/physical/zoo/Panda.java @@ -6,38 +6,36 @@ import ch.epfl.maze.util.Vector2D; /** * Panda A.I. that implements Trémeaux's Algorithm. - * */ public class Panda extends Animal { - /** - * Constructs a panda with a starting position. - * - * @param position - * Starting position of the panda in the labyrinth - */ + /** + * Constructs a panda with a starting position. + * + * @param position Starting position of the panda in the labyrinth + */ - public Panda(Vector2D position) { - super(position); - // TODO - } + public Panda(Vector2D position) { + super(position); + // TODO + } - /** - * Moves according to Trémeaux's Algorithm: when the panda - * moves, it will mark the ground at most two times (with two different - * colors). It will prefer taking the least marked paths. Special cases - * have to be handled, especially when the panda is at an intersection. - */ + /** + * Moves according to Trémeaux's Algorithm: when the panda + * moves, it will mark the ground at most two times (with two different + * colors). It will prefer taking the least marked paths. Special cases + * have to be handled, especially when the panda is at an intersection. + */ - @Override - public Direction move(Direction[] choices) { - // TODO - return Direction.NONE; - } + @Override + public Direction move(Direction[] choices) { + // TODO + return Direction.NONE; + } - @Override - public Animal copy() { - // TODO - return null; - } + @Override + public Animal copy() { + // TODO + return null; + } } diff --git a/src/ch/epfl/maze/physical/zoo/SpaceInvader.java b/src/ch/epfl/maze/physical/zoo/SpaceInvader.java index 0d8fb5d..f5963b1 100644 --- a/src/ch/epfl/maze/physical/zoo/SpaceInvader.java +++ b/src/ch/epfl/maze/physical/zoo/SpaceInvader.java @@ -15,38 +15,36 @@ import ch.epfl.maze.util.Vector2D; * efficient than the animals you had to implement. *
* The way we measure efficiency is made by the test case {@code Competition}. - * - * @see ch.epfl.maze.tests.Competition Competition - * + * + * @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(Direction[] choices) { - // TODO (bonus) - return Direction.NONE; - } - - @Override - public Animal copy() { - // TODO (bonus) - return null; - } + /** + * 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(Direction[] choices) { + // TODO (bonus) + return Direction.NONE; + } + + @Override + public Animal copy() { + // TODO (bonus) + return null; + } } -- cgit v1.2.3