Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IIlegal move #23

Open
olufjen opened this issue Mar 11, 2021 · 6 comments
Open

IIlegal move #23

olufjen opened this issue Mar 11, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@olufjen
Copy link
Owner

olufjen commented Mar 11, 2021

The active player makes an illegal move as shown below:
Action
ChessAction: Preferred Position f3 Piece Piece positione2 X, Y (4, 1) wP e2PAWNName P
Available positions
Position: e3 B X, Y (4, 2)
Position: e4 W X, Y (4, 3)
Removed positions
Possible move Move
Piece Piece positione2 X, Y (4, 1) wP e2PAWNName P
Available positions
Position: e3 B X, Y (4, 2)
Position: e4 W X, Y (4, 3)
Removed positions

From position e2 Color W Piece no.chess.web.model.ChessPiece Ontology name WhitePawn5
Chesspiece position e2
Piece active: true true gamepiece null

To position f3 Color W Piece no.chess.web.model.ChessPiece Ontology name WhitePawn7

This move appears as a "no move" see picture below

@olufjen olufjen added the bug Something isn't working label Mar 11, 2021
@olufjen
Copy link
Owner Author

olufjen commented Mar 11, 2021

image.png

@olufjen
Copy link
Owner Author

olufjen commented Mar 13, 2021

From the ontposition file :

Protected positions f3 Color W Piece no.chess.web.model.ChessPiece Ontology name WhitePawn7
Chesspiece position f3
Piece active: true true gamepiece null

Protected positions d3 Color W Piece None false gamepiece Gamenone

Attacked positions f3 Color W Piece no.chess.web.model.ChessPiece Ontology name WhitePawn7
Chesspiece position f3
Piece active: true true gamepiece null

Attacked positions d3 Color W Piece None false gamepiece Gamenone

Preferred position set to e3 Color B Piece None false gamepiece Gamenone

Piece:

Piece positione2 X, Y (4, 1) wP e2PAWNName P
Available positions
Position: e3 B X, Y (4, 2)
Position: e4 W X, Y (4, 3)
Removed positions

Evaluation value:

19.0

@olufjen
Copy link
Owner Author

olufjen commented Mar 15, 2021

For the problemsolver:
The checkpieceFacts method must be changed so that it can check for protection by any piece

parti160321.PNG

After move: Bf5 the Knight at d5 is replaced by the white pawn !!
The Knight moved from b1 to d5 !!!

PROTECTEDBY(x,d5)
Is found to be true, but x is not instansiated to WhiteBishop2 !!!

NO MOVE !!! Checking piecefacts for
PROTECTEDBY piece WhiteBishop2 and action ChessAction: Preferred Position Unknown Piece Piece position f1 X, Y (5, 0) wB f1 BISHOP

@olufjen
Copy link
Owner Author

olufjen commented Mar 17, 2021

A wrong set of removed positions:
Move: Move
Piece Piece position f3 X, Y (5, 2) wN f3 KNIGHT ActiveName N
Available positions
Position: e5 B X, Y (4, 4)
Position: d4 B X, Y (3, 3) Occupied by: BlackKnight1
Position: g1 B X, Y (6, 0)
Position: h2 B X, Y (7, 1) Occupied by: WhitePawn8
Position: e1 B X, Y (4, 0) Occupied by: WhiteKing
Position: h4 B X, Y (7, 3)
Position: g5 B X, Y (6, 4)
Position: d2 B X, Y (3, 1)
Removed positions
Position: h2 B X, Y (7, 1) Occupied by: WhitePawn8
Position: e1 B X, Y (4, 0) Occupied by: WhiteKing
Position: d4 B X, Y (3, 3) Occupied by: BlackKnight1

Does not know that the white pawn in d4 has been removed !!!

NB!!: ????
PAWNATTACK(WhitePawn2,c3)
Trying to prove
THREATENEDBY(x,c3)
Piece is safe to take with : WhitePawn2
BlackPawn5

@olufjen
Copy link
Owner Author

olufjen commented Mar 22, 2021

A possible null move:
The chessAgent returns a null chessAction

queenmove.PNG

Action.processPosition new move is null Move
Piece Piece position d1 X, Y (3, 0) wQ d1 QUEEN ActiveName Q
Available positions
Position: h1 W X, Y (7, 0) Occupied by: WhiteRook2
Position: g1 B X, Y (6, 0)
Position: f1 W X, Y (5, 0) Occupied by: WhiteBishop2
Position: e1 B X, Y (4, 0) Occupied by: WhiteKing
Position: d2 B X, Y (3, 1) Occupied by: WhiteBishop1
Position: c1 B X, Y (2, 0)
Position: d3 W X, Y (3, 2)
Position: b1 W X, Y (1, 0)
Position: d4 B X, Y (3, 3) Occupied by: WhiteKnight2
Position: a1 B X, Y (0, 0) Occupied by: WhiteRook1
Position: d5 W X, Y (3, 4) Occupied by: BlackPawn3
Position: d6 B X, Y (3, 5)
Position: d7 W X, Y (3, 6)
Position: d8 B X, Y (3, 7) Occupied by: BlackQueen
Position: b3 W X, Y (1, 2)
Position: a4 W X, Y (0, 3)
Position: e2 W X, Y (4, 1) Occupied by: WhitePawn5
Position: f3 W X, Y (5, 2)
Position: g4 W X, Y (6, 3)
Position: h5 W X, Y (7, 4)
Position: c2 W X, Y (2, 1)
Removed positions
Position: h1 W X, Y (7, 0) Occupied by: WhiteRook2
Position: f1 W X, Y (5, 0) Occupied by: WhiteBishop2
Position: e1 B X, Y (4, 0) Occupied by: WhiteKing
Position: d2 B X, Y (3, 1) Occupied by: WhiteBishop1
Position: d4 B X, Y (3, 3) Occupied by: WhiteKnight2
Position: d4 B X, Y (3, 3) Occupied by: WhiteKnight2
Position: a1 B X, Y (0, 0) Occupied by: WhiteRook1
Position: d6 B X, Y (3, 5)
Position: e2 W X, Y (4, 1) Occupied by: WhitePawn5
Position: f3 W X, Y (5, 2)
Position: g4 W X, Y (6, 3)
Position: h5 W X, Y (7, 4)
Position: g1 B X, Y (6, 0)
Position: c1 B X, Y (2, 0)
Position: b1 W X, Y (1, 0)
Position: d3 W X, Y (3, 2)
Position: d5 W X, Y (3, 4) Occupied by: BlackPawn3
Position: d7 W X, Y (3, 6)
Position: d8 B X, Y (3, 7) Occupied by: BlackQueen

From position d1 Color W Piece no.chess.web.model.ChessPiece Ontology name WhiteQueen
Chesspiece position d1
Piece active: true true gamepiece null

To position b3 Color W Piece None false gamepiece Gamenone
Move number 0
Creation Created from gamepiece preferred position
mar 22, 2021 1:58:03 PM org.restlet.resource.ServerResource doCatch
WARNING: Exception or error caught in server resource
Internal Server Error (500) - The server encountered an unexpected condition which prevented it from fulfilling the request
Caused by: java.lang.NullPointerException
at no.chess.web.model.PlayGame.proposeMove(PlayGame.java:279)
at no.chess.web.server.resource.RapporterChessStartServerResourceHTML.storeChess(RapporterChessStartServerResourceHTML.java:778)

@olufjen
Copy link
Owner Author

olufjen commented Mar 23, 2021

Solved:
The checkFacts method of the chessProblemsolver has been changed

@olufjen olufjen closed this as completed Mar 23, 2021
@olufjen olufjen reopened this Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant