Open olufjen opened 2 years ago
Fixed 18.1022 The following message is a bug: The following piece is available as protector for position e4: WhitePawn5 and is at e2 Produced in the Aperfomance object
When the opponent king can be taken, then a warning must be given, and moves must be backtracked.
When opponent castling is performed only this move is shown: Piece BlackKingFrom position e8 Color W Direction NONE sumdif 2 Piece None false Friendly false gamepiece Gamenone To position g8 Color W Direction NONE sumdif 4 Piece no.chess.web.model.ChessPiece Ontology name BlackKing Chesspiece position g8 Move number 12 o-oCreation Created with from and to position
When player performs castling, these moves are recorded: Piece WhiteKingFrom position e1 Color B Direction NONE sumdif 4 Piece None false Friendly false gamepiece Gamenone To position g1 Color B Direction NONE sumdif 6 Piece no.chess.web.model.ChessPiece Ontology name WhiteKing Chesspiece position g1 Piece active: true true Friendly false gamepiece null Move number 15 o-oCreation Created with from and to position Move Piece WhiteRook2From position h1 Color W Direction NONE sumdif 7 Piece None false Friendly false gamepiece Gamenone To position f1 Color W Direction NONE sumdif 5 Piece no.chess.web.model.ChessPiece Ontology name WhiteRook2 Chesspiece position f1 Piece active: true true Friendly false gamepiece null Move number 16 o-oxCreation Created with from and to position Piece active: true true Friendly false gamepiece null The move number must not be increased.
Check the chooseStrategy method: Here we must find which opponent pieces are at these reachable positions OLJ 24.10.22:
Checking reachable for key WhiteKnight1_e4c5 from occupied position e4 can then reach position c5 For pawns, we need to calculate new attack positions from these new possible positions.
From a game 21.12.22:
Moving black bishop to f5 produces this error: Caused by: java.lang.NullPointerException at no.chess.web.model.PlayGame.proposeMove(PlayGame.java:311) No move is selected! The ProblemSolver returns with no Problem to solve. https://app.zenhub.com/files/137453363/85016b24-aac2-47be-8773-b51a7203e5e0/download
The next game: Player makes no move: https://app.zenhub.com/files/137453363/a4fcc669-ff81-40b0-bf40-e2b02b1d6322/download Chosen action Schema Action(WhiteKnight2_d4) PRECOND:^PROTECTEDBY(WhiteQueen,d4)^PROTECTEDBY(WhitePawn5,d4)^occupies(WhiteKnight2,f3)^REACHABLE(WhiteKnight2,d4)^PIECETYPE(WhiteKnight2,KNIGHT) EFFECT:^occupies(WhiteKnight2,d4)^PIECETYPE(WhiteKnight2,KNIGHT) The new position and the preferred position d4 d4 This move cannot be made. The d4 position is occupied by a friendly piece. Knights have not removed positions of friendly pieces !! See ChessProblemSolver - checkopponentThreat
24.12.22 Added removed positions for knight. This is the resulting game. https://app.zenhub.com/files/137453363/9600869b-2067-4400-9324-edf3bacd5dd2/download
How to make a strategy out of this? Pick out: WhiteQueen Can threaten the king from c4 or: The piece can take the king from h7 and move is possible? false The following piece is available as protector for position h7: WhiteBishop2 and is at d3
See also game: https://app.zenhub.com/files/137453363/a18a1f8d-e34a-4f92-b0ae-0fe3ebcfc0b1/download
Investigating for piece WhiteQueen at a6 with type QUEEN and position to move to a5 The piece can take the king from g1 and move is possible? false The piece can take the king from g2 and move is possible? false The piece can take the king from g3 and move is possible? false The piece can take the king from g4 and move is possible? false The piece can take the king from g5 and move is possible? false The following piece is available as protector for position g5: WhiteKnight2 and is at f3 The piece can take the king from g6 and move is possible? false The following piece is available as protector for position g6: WhiteBishop2 and is at d3 The piece can take the king from h8 and move is possible? false The piece can take the king from g7 and move is possible? false The piece can take the king from f8 and move is possible? false The piece can take the king from e8 and move is possible? false The piece can take the king from d8 and move is possible? false The piece can take the king from c8 and move is possible? false The following piece is available as protector for position c8: WhiteQueen and is at a6 WhiteQueen Can threaten the king from c8 The piece can take the king from b8 and move is possible? false The piece can take the king from a8 and move is possible? false The piece can take the king from f7 and move is possible? false The piece can take the king from e6 and move is possible? false The piece can take the king from d5 and move is possible? false The piece can take the king from c4 and move is possible? false The following piece is available as protector for position c4: WhiteBishop2 and is at d3 The following piece is available as protector for position c4: WhiteQueen and is at a6 WhiteQueen Can threaten the king from c4 The piece can take the king from b3 and move is possible? false The piece can take the king from a2 and move is possible? false The piece can take the king from h7 and move is possible? false The following piece is available as protector for position h7: WhiteBishop2 and is at d3
When moving to take pawn at d5:
Caused by: java.lang.NullPointerException
at no.games.chess.planning.ChessLevel.
1 d4 d5 2 c4 Nf6 3 Nc3 e6 4 Nf3 Bd6 5 cxd5 exd5 6 e3 o-o 7 Bd3 h6 8 o-o Nc6 9 Qb3 a6 10 Nxd5 Nxd5 11 Qxd5 Be6 12 Qe4 f5 13 Qxe6 Rf7 14 Qxf7 Kxf7 15 Bc4 Kf8 16 Be2 -
Opponent King is also a protector. See the above game.
We can use a Percept schema as a description of a move the opponent makes. Define and implement the following chess strategies: