ctabin / jchess

Simple Java Chess API
GNU Lesser General Public License v2.1
11 stars 3 forks source link

Is is possible to check special moves? #52

Open 9acca9 opened 1 month ago

9acca9 commented 1 month ago

Hi. Sorry the ignorance. I made a little app in python using python-chess (a module to chess validation move), with this module you can ask if certain moves are "en passant", "castling", "promotion". For example:

if chess_board.is_castling(move): 
      do...

if move is a move that is castling the if will be true

Now im trying to replicate my app but with Java... (im trying to learn java...) It is possible to know if this moves are happening with your library?

Thanks!

ctabin commented 1 month ago

Hi @9acca9,

I'm afraid there is no such simple method to do that. I might consider adding this. For now, one simple way to check if a move is "special", is to check if there are linked displacement. If it is a King or Rook, then it's a castling move.