我正在使用SWI-Prolog checkneighbours(X,Y) :- retractall(vecini(_)), assert(vecini(0)), foreach(I in X-1..X+1, (foreach J in Y-1..Y+1, (map(I,J,Z), ( Z=:= "X" ->