I need to find the states that are next to my pacman agent. The current state is Tuple(3,5) which is given by numPos.
I need to check the position that are around the pacman agent. I want to find the neighbouring states so that i can check it with the ghosts states and if they matches, that means , a ghost is present in the neighbouring side. But I am not able to find the neighbouring states. Like , I need to check (x, y+1), (x,y-1) , (y,x+1), (y, x-1). How do i implement it.I cannot use the range function here.