olufjen / chess

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

Week 26 (June 28) Planning strategies: #29

Open olufjen opened 3 years ago

olufjen commented 3 years ago

Planning strategies: For all my actions: Give the piece of this action a new position from the list of available and not removed positions. (produceLegalMoves) the use the player to calculate all removed positions (calculatePreferredPosition). Then find which opponent pieces I can take. And find which of my own pieces I protect

olufjen commented 3 years ago

Fails after 15 moves: 0 - - 1 d4 d5 2 c4 Nf6 3 Nc3 e6 4 Nf3 Bd6 5 cxd5 o-o 6 e3 h6 7 Bc4 exd5 8 o-o dxc4 9 h3 Nc6 10 h4 h5 11 d5 Ne5 12 Nd4 Nxd5 13 Nxd5 Be6 14 Nc3 a6 15 a3 -

Caused by: java.lang.NullPointerException at no.chess.web.model.PlayGame.proposeMove(PlayGame.java:309) The chess agent returns no action

olufjen commented 3 years ago

From the temporary knowledge base: occupies(WhiteKing,f1) REACHABLE(WhiteKingf1,g1) REACHABLE(WhiteKingf1,g2) REACHABLE(WhiteKingf1,e1) REACHABLE(WhiteKingf1,e2)

These facts tell that we can reach certain positions given that we occupy f1

olufjen commented 3 years ago

The prepareAction method must be reworked.

olufjen commented 3 years ago

Add to the result knowledge base: which positions are occupied by opponent pieces. Then: Which position is occupied by the opponent king? Which position is occupied by the opponent queen? Which position is occupied by the opponent rooks? Can I reach any of these positions? Can I reach any of these positions if I move a piece to a reachable position?