lichess-org / dartchess

Dart chess library for native platforms
https://pub.dev/packages/dartchess
GNU General Public License v3.0
35 stars 18 forks source link

Add Chess♯ variant #17

Closed dbergan closed 1 year ago

dbergan commented 1 year ago

The rules for Chess♯ can be found at https://chess-sharp.games/ChessSharp_Rules.pdf

veloce commented 1 year ago

Awesome! I don't know this chess variant. Will look into it :)

veloce commented 1 year ago

Do you know if perft tests are available for this variant? We use perft to test all the logic, it's important to ensure the validity.

dbergan commented 1 year ago

Hi Vincent!

Thanks for taking the time to look at Chess♯. This variant is only a year old and my dart code is literally the only digital version of it. It doesn't exist in any other programming language. There aren't any perfts.

I tried to exhaustively test all of Chess♯'s rules in \test\chess_sharp_test.dart. For example, it attempts to drop pieces on every square on the board, even though that's only legal in rows 1 (for White) and 8 (for Black).

I'm using dartchess to create my own Chess♯ flutter app that teaches the concepts and allows users to play non-timed (correspondence) games with each other. Chess♯'s aim is to be easier for kids to learn, but still retain the core experience of classical chess. Thus, Chess♯ doesn't have the "tricky" aspects of checkmate, en passant, pawn sprinting, castling, and underpromoting. And because there's no set opening position, there's no scholar's mate. (It's too easy for some kids to just learn the scholar's mate, beat all their friends, and go no further in learning chess. With Chess♯, all kids have to think from the first move because it's always unexplored territory.) National Master Elliott Neff and I have been teaching it to Kindergartners and 1st graders in our local school district and the reception has been very positive so far. We're making the app so that parents have a reference to go to when they play with their kids at home.

That said, I think you'll find that even though Chess♯ is designed to be easier to teach to kids, it's not in any way limited to kids. It feels much closer to a game of classical chess, than, say, Crazyhouse. Chess960 is probably the closest experience of the other variants in dartchess... but Chess960 is a nightmare to try to teach to children. They can't set up the board properly, much less castle. I have some pgns of Chess♯ games in the data folder if you want to observe adults playing each other.

Anyway, thanks again for taking a look at this. If we keep our branches in sync, then dartchess will definitively have the most accurate ruleset for Chess♯. (Whether or not lichess includes it in their UI is totally up to the powers that be...)

Kind regards, David

veloce commented 1 year ago

Hi David! Thanks for taking the time to explain what is chess sharp. I'm glad you picked dartchess as a basis for your new app :)

I will take the time to properly review the code but so far I don't see any issue in merging this. Looks like the implementation is clean and will not add maintenance burden on my side. I also like the educational value of this new variant. So I wish you all the success with your new application!

Kind regards, Vincent

dbergan commented 1 year ago

Hi Vincent!

Thanks for the thorough review! I think I agree with every suggestion you made. Please bear with me as even though I'm an experienced programmer (20+ years), I don't have a lot of experience using github for collaboration. I didn't realize that all the perft code I wrote subsequent to the initial Chess♯ pull request was also getting included in this PR. Give me some time to figure out the git tools and then I'll propose clean PRs that address all your comments.

Have a great weekend!

Kind regards, David