Generate a maze and find a path from beginning point to ending point