diff options
author | Pacien TRAN-GIRARD | 2015-11-21 18:47:10 +0100 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2015-11-21 18:47:10 +0100 |
commit | 00c2ba041b65d8777925da699125f10911f4a7e0 (patch) | |
tree | 4f92693247f83df52833f832e263f7ade82b239a /src/ch/epfl/maze | |
parent | 2d592a87e00c7d0248f53f388269de902afe6916 (diff) | |
download | maze-solver-00c2ba041b65d8777925da699125f10911f4a7e0.tar.gz |
Handle the "stuck" case
Diffstat (limited to 'src/ch/epfl/maze')
-rw-r--r-- | src/ch/epfl/maze/physical/ProbabilisticAnimal.java | 1 |
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 | ||