olufjen / chess

Programs to utilize chess ontologies, and play games of chess
1 stars 0 forks source link

Check if a piece occupies two positions #14

Closed olufjen closed 3 years ago

olufjen commented 4 years ago

The chessboard sometimes shows a piece (pawn) occupying two positions. This is a result of incorrect backtrack from movements made during minimax search.

olufjen commented 4 years ago

backtrack.PNG

This is caused by mixing who's turn it is to move

olufjen commented 4 years ago

bugmove.PNGThis is also the same bug. Move 4: white pawn takes Knight at c6. Bishop moves to e6. Move 5 is meaningless

olufjen commented 4 years ago

After7 moves. Several pieces have more than one position.bugmove2.PNG

olufjen commented 4 years ago

After 5 moves: The Na6 move should have been Be6, followed by a white move.

bugmove3.PNG

This happens after the currDepthLimit of ChessAphaBetaSearch has a max value of 1.

olufjen commented 3 years ago

The problems described above occur in the following setting: ** Analyzing state *** To move Piece ==================== Chessstate Piece positionc3 X, Y (2, 2) wN c3KNIGHTName N My features 47 Opponent features 37 state utility 28.0 No of pieces white 13 No of pieces black 10 To move Piece ==================== Chessstate Piece positionh6 X, Y (7, 5) wB c1BISHOPName B

There are 15 such moves, and then it is the opponent to play. This move during chessstate causes the opponent to become the player. This move during chessstate can only occur while calling the chesstate. mark method.

What to do about this piece of code in the .mark method? /*

This issue has been solved by avoiding internal moves in the chesstate .mark method