Its deleting a second from first while adding a first in second when it should be deleting from both.
https://github.com/angdav/cs435-p2/blob/7773ebbbc02f04d5968b58217efb4db4635591ad/p6.py#L26-L30
so something like:
if (abs(first.x - second.x) == 1) != (abs(first.y - second.y) == 1):if second in first.neighbors and first in second.neighbors:first.neighbors.remove(second)second.neighbors.remove(first)
should work.
Its deleting a second from first while adding a first in second when it should be deleting from both. https://github.com/angdav/cs435-p2/blob/7773ebbbc02f04d5968b58217efb4db4635591ad/p6.py#L26-L30 so something like:
if (abs(first.x - second.x) == 1) != (abs(first.y - second.y) == 1):
if second in first.neighbors and first in second.neighbors:
first.neighbors.remove(second)
second.neighbors.remove(first)
should work.