Generates and solves a maze.