Giter VIP home page Giter VIP logo

Comments (4)

edupont avatar edupont commented on July 21, 2024 1

I have just seen that the issue #1 is related to this. The position in the picture is a checkmate for white.

No, there was no checkmate message.

In the case of checkmate (and of stalemate), the player has no legal move. I don't know what the engine attempts to do in this case, but from your comment in issue #1, it sounds like the engine attempts an illegal move instead. If this is the case, I would suggest you handle it this way:

  • Don't play the illegal move, because it is just the engine assuming that the game is over
  • If the engine is in a check position (and has no legal moves), it is a checkmate
  • If the engine is not in a check position (and has no legal moves), it is a stalemate (draw)

from chessmarkable.

LinusCDE avatar LinusCDE commented on July 21, 2024

I had some struggle with that already. The things is that the bot tends to make non-moving moves (just moves from src to dest) when the king is cornered. As far as I understand it, this is not legal at all. Some check (gives_check(...) or similar) does a assert against that which is why I replaced it with a null move. But this is also a quite hacky solution. I need to look up better ways on that.

Did the "Checkmate!" appear before the crash?

from chessmarkable.

LinusCDE avatar LinusCDE commented on July 21, 2024

Good idea. I could reproduce the bug on checkmating the bot as well. I'll try to fix that in the evening (in about 6 hours) since I have lectures atm. I'll also probably add the possibility to import/export the board as FEN to speed up testing your suggested fix which sounds promising.

from chessmarkable.

LinusCDE avatar LinusCDE commented on July 21, 2024

I think that I have sorted it out now. It now recognized a stalemate and check even before the bot tries to pull as "null move".

Here is a FEN that can easily result in a stalemate: 8/8/2Q5/4k3/1R6/8/6K1/8 w - - 0 46 (start with this state by setting -i to it).
This one can be used to checkmate the black: 1R7/8/2Q5/4k3/1R6/8/6K1/8 w - - 0 46 (just added another rook to the mix).

Seems to work fine now. Let me know if you still manage to crash it.

from chessmarkable.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.