Java Program to solve a random Maze