Разработка программы для игры в морской бой с игровым полем 10х10 позиций, страница 9

        retract(pl(kletka(pole(XX,YY),_)),pole).

mykill:-pl(kletka(pole(X,Y),2)),pl(kletka(pole(XX,YY),2)),

        Y=YY,X<>XX,

        min(X,XX,Z),max(X,XX,ZZ),

        XA=ZZ+1,XB=Z-1,YA=Y-1,YB=Y+1,

        mychange(X,Y,7),mychange(X,YA,5),mychange(X,YB,5),

        mychange(XX,Y,7),mychange(XX,YA,5),mychange(XX,YB,5),

        mychange(XA,Y,5),mychange(XA,YA,5),mychange(XA,YB,5),

        mychange(XB,Y,5),mychange(XB,YA,5),mychange(XB,YB,5),

        retract(pl(kletka(pole(X,Y),_)),pole),

        retract(pl(kletka(pole(XX,YY),_)),pole).

% убийство трехпалубного

mykill:-pl(kletka(pole(X,Y),3)),pl(kletka(pole(XX,YY),3)),

        pl(kletka(pole(XXX,YYY),3)),

        X=XX,X=XXX,Y<>YY,Y<>YYY,YY<>YYY,

        min(Y,YY,B),min(B,YYY,Z),max(Y,YY,BB),max(BB,YYY,ZZ),

        XA=X+1,XB=X-1,YA=Z-1,YB=ZZ+1,

        mychange(X,Y,8),mychange(XB,Y,5),mychange(XA,Y,5),

        mychange(X,YY,8),mychange(XB,YY,5),mychange(XA,YY,5),

        mychange(X,YYY,8),mychange(XB,YYY,5),mychange(XA,YYY,5),

        mychange(X,YB,5),mychange(XB,YB,5),mychange(XA,YB,5),

        mychange(X,YA,5),mychange(XB,YA,5),mychange(XA,YA,5),

        retract(pl(kletka(pole(X,Y),_)),pole),   

        retract(pl(kletka(pole(XX,YY),_)),pole),

        retract(pl(kletka(pole(XXX,YYY),_)),pole).

mykill:-pl(kletka(pole(X,Y),3)),pl(kletka(pole(XX,YY),3)),

        pl(kletka(pole(XXX,YYY),3)),

        Y=YY,Y=YYY,X<>XX,X<>XXX,XX<>XXX,

        min(X,XX,B),min(B,XXX,Z),max(X,XX,BB),max(BB,XXX,ZZ),

        XA=ZZ+1,XB=Z-1,YA=Y-1,YB=Y+1,

        mychange(X,Y,8),mychange(X,YA,5),mychange(X,YB,5),

        mychange(XX,Y,8),mychange(XX,YA,5),mychange(XX,YB,5),

        mychange(XXX,Y,8),mychange(XXX,YA,5),mychange(XXX,YB,5),

        mychange(XA,Y,5),mychange(XA,YA,5),mychange(XA,YB,5),

        mychange(XB,Y,5),mychange(XB,YA,5),mychange(XB,YB,5),

        retract(pl(kletka(pole(X,Y),_)),pole),

        retract(pl(kletka(pole(XX,YY),_)),pole),

        retract(pl(kletka(pole(XXX,YYY),_)),pole).

% кораблекрушение четырехпалубного

mykill:-pl(kletka(pole(X,Y),4)),pl(kletka(pole(XX,YY),4)),

        pl(kletka(pole(XXX,YYY),4)),pl(kletka(pole(XXXX,YYYY),4)),

        X=XX,X=XXX,X=XXXX,Y<>YY,Y<>YYY,Y<>YYYY,YY<>YYY,YY<>YYYY,YYY<>YYYY,

        min(Y,YY,B),min(B,YYY,C),min(C,YYYY,Z),

        max(Y,YY,BB),max(BB,YYY,CC),max(CC,YYYY,ZZ),

        XA=X+1,XB=X-1,YA=Z-1,YB=ZZ+1,

        mychange(X,Y,9),mychange(XB,Y,5),mychange(XA,Y,5),

        mychange(X,YY,9),mychange(XB,YY,5),mychange(XA,YY,5),

        mychange(X,YYY,9),mychange(XB,YYY,5),mychange(XA,YYY,5),

        mychange(X,YYYY,9),mychange(XB,YYYY,5),mychange(XA,YYYY,5),

        mychange(X,YB,5),mychange(XB,YB,5),mychange(XA,YB,5),

        mychange(X,YA,5),mychange(XB,YA,5),mychange(XA,YA,5),

        retract(pl(kletka(pole(X,Y),_)),pole),   

        retract(pl(kletka(pole(XX,YY),_)),pole),

        retract(pl(kletka(pole(X,Y),_)),pole),   

        retract(pl(kletka(pole(XX,YY),_)),pole).

mykill:-pl(kletka(pole(X,Y),4)),pl(kletka(pole(XX,YY),4)),

        pl(kletka(pole(XXX,YYY),4)),pl(kletka(pole(XXXX,YYYY),4)),

        Y=YY,Y=YYY,Y=YYYY,X<>XX,X<>XXX,X<>XXXX,XX<>XXX,XX<>XXXX,XXX<>XXXX,

        min(X,XX,B),min(B,XXX,C),min(C,XXXX,Z),

        max(X,XX,BB),max(BB,XXX,CC),max(CC,XXXX,ZZ),

        XA=ZZ+1,XB=Z-1,YA=Y-1,YB=Y+1,

        mychange(X,Y,9),mychange(X,YA,5),mychange(X,YB,5),

        mychange(XX,Y,9),mychange(XX,YA,5),mychange(XX,YB,5),

        mychange(XXX,Y,9),mychange(XXX,YA,5),mychange(XXX,YB,5),

        mychange(XXXX,Y,9),mychange(XXXX,YA,5),mychange(XXXX,YB,5),

        mychange(XA,Y,5),mychange(XA,YA,5),mychange(XA,YB,5),

        mychange(XB,Y,5),mychange(XB,YA,5),mychange(XB,YB,5),

        retract(pl(kletka(pole(X,Y),_)),pole),

        retract(pl(kletka(pole(XX,YY),_)),pole),

        retract(pl(kletka(pole(XXX,YYY),_)),pole),

        retract(pl(kletka(pole(XXXX,YYYY),_)),pole).

mykill.