Maze solver using Prolog