If this was flash. They could have added a variable with a random generated number between 0 to 10000 that changed every loop and only if it hit a specific number would the flash break the loop and advance to where the ball comes out. For no reason too.