summaryrefslogtreecommitdiff
path: root/src/ch/epfl/maze/physical
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2015-11-21 18:47:10 +0100
committerPacien TRAN-GIRARD2015-11-21 18:47:10 +0100
commit00c2ba041b65d8777925da699125f10911f4a7e0 (patch)
tree4f92693247f83df52833f832e263f7ade82b239a /src/ch/epfl/maze/physical
parent2d592a87e00c7d0248f53f388269de902afe6916 (diff)
downloadmaze-solver-00c2ba041b65d8777925da699125f10911f4a7e0.tar.gz
Handle the "stuck" case
Diffstat (limited to 'src/ch/epfl/maze/physical')
-rw-r--r--src/ch/epfl/maze/physical/ProbabilisticAnimal.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ch/epfl/maze/physical/ProbabilisticAnimal.java b/src/ch/epfl/maze/physical/ProbabilisticAnimal.java
index 6b0c57f..f62fea1 100644
--- a/src/ch/epfl/maze/physical/ProbabilisticAnimal.java
+++ b/src/ch/epfl/maze/physical/ProbabilisticAnimal.java
@@ -32,6 +32,7 @@ abstract public class ProbabilisticAnimal extends Animal {
32 32
33 @Override 33 @Override
34 public Direction move(Direction[] choices) { 34 public Direction move(Direction[] choices) {
35 if (choices.length == 0) return Direction.NONE;
35 return choices[randomSource.nextInt(choices.length)]; 36 return choices[randomSource.nextInt(choices.length)];
36 } 37 }
37 38