Why does this give
java.lang.ArrayIndexOutOfBoundsException: 535 at Pad.act(Pad.java:56) at greenfoot.core.Simulation.actActor(Simulation.java:507) at greenfoot.core.Simulation.runOneLoop(Simulation.java:470) at greenfoot.core.Simulation.runContent(Simulation.java:204) at greenfoot.core.Simulation.run(Simulation.java:194)
//Code System.out.println("Unknown failure"); failtimes[value]++;//line 56 System.out.println("Fail times: "+failtimes[value]+" Pad number "+value); //Note: failtimes has an index of Integer.MAX_VALUE, so it is like impossible to go out of bounds.