DRAFT: Breaking out the library from the challenge. #496
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Okay, this is the result of a few hours work last night. I'm pretty pleased with it.
I did this all in my own mirror of the code which is the core of a lichess bot I deployed a few months ago. That bot is currently live, using the changes in this PR.
Let me lay out what I did:
ChessEngine
. This is a .NETLibrary
project, so it is ingestible from other .NET projects, which brings us toSpan
s is much better than the existingList
- andArray
-based implementations I've found. It wasn't a deep survey, though, so I could be missing something.ChessEngine
project as a dependency. Still works great :)I still have a lot of cleanup I want to do, mostly around naming conventions and things like that. I don't like that the
ChessEngine
doesn't have one, singular interface into it, but that's a larger architectural change to the engine itself. It's also not technically an engine, since an engine actually plays chess, whereas this is just the board/move logic.Merging this will make it easier, I think, to address #409. As you can see from my linked GitLab repo, I already have a working UCI implementation for this, so I'm very confident merging this would be beneficial, of only to make it easier for folks to use their own UCI wrappers.
I'd love to see this engine published as a package. It's been mentioned before in #360, and probably others. I'd love to see this merged in and pushed up to NuGet, though I can totally understand if that's not something that you want to maintain going forward.
If you decide not to publish a package, I'd be interested in using this work as an upstream to my repo, where I would publish it as a package; I just have no interest in maintaining the "chess" parts of it, haha!
However you'd like to move forward with that, I'm happy with.