lichess-org / scalachess

Chess API written in scala. Immutable and free of side effects.

Home Page:https://lichess.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exploded king atomic position yields legal moves

hyperbotauthor opened this issue · comments

I would like to use your library from Javascript. I'm aware of https://github.com/veloce/scalachessjs, but it is a WebWorker and also I need some additional functionality ( for example listing legal moves in a position ), which it does not have.

To this end I compiled your library to Javascript myself:

https://github.com/hyperbotauthor/scalachess

The legal moves for a position I determine like this:

https://github.com/hyperbotauthor/scalachess/blob/dd88ce2a41e62ec7a6bad16f04d98c65f37aade0/src/main/scala/ChessApp.scala#L51

I created a minimal GUI to test legal move generation:

https://scalachess.netlify.app

If you select atomic from the variant combo, and make the moves e2e3, e7e6, d1f3, d7d6, f3f7 ( either by clicking or by selecting from legal move list ), this should end the game due to black king being exploded and there should be no legal moves. Yet the position lists legal moves, which are just pseudo legal, as black has no king.

img