rat in a maze using backtracking