diff --git a/src/com/intermediate/endsection/Gang.java b/src/com/intermediate/endsection/Gang.java index c2181e7..7f05a77 100644 --- a/src/com/intermediate/endsection/Gang.java +++ b/src/com/intermediate/endsection/Gang.java @@ -42,7 +42,7 @@ private boolean isSuccessfulRobbery() { } public void letsRob(Building[] buildings) { - int randomBuildingIndex = randomNumberGenerator.nextInt(buildings.length + 1); + int randomBuildingIndex = randomNumberGenerator.nextInt(buildings.length); System.out.println("-------------------------------"); if (isSuccessfulRobbery()) { System.out.println("The gang managed to rob the following items from the " + buildings[randomBuildingIndex].getName() + ":");