dobro / binbo Goto Github PK
View Code? Open in Web Editor NEWChess representation written in Erlang using Bitboards, ready for use on game servers
License: Apache License 2.0
Chess representation written in Erlang using Bitboards, ready for use on game servers
License: Apache License 2.0
Hi, I am potentially looking to use this library for data analysis purposes in tandom with Nx libraries. I was wondering if there is a function I missed for getting the underlying game state as a bitboard. Thanks!
I love this library! Thanks for the great work.
I wonder if it's feasible to make use of an engine over TCP, such as stockfish in a docker container, hosted or otherwise.
Alternately I think I could co-locate binbo and stockfish in one container together.
Greetings, and excellent library!
I think I ran across an issue with validating FEN when there are three rooks on the board:
iex(1)> :binbo_game.new("r3k2r/2p1qppp/p3p3/n2n4/P2P4/P2QPNP1/1p1N1PBP/2r1RRK1 b kq - 0 1")
{:error, {:castling, {:black, :both_sides}}}
That position results from the pawn at c2 advancing to c1 and under-promoting to rook.
I'm not confident enough in my Erlang to submit a pull request, but I think it may just be a matter of changing line 1011 of src/binbo_position.erl from:
case IsKingOnPlace andalso (RooksBB =:= (SqABB bor SqHBB)) of
to something like:
case IsKingOnPlace andalso (RooksBB band (SqABB bor SqHBB)) =:= (SqABB bor SqHBB) of
So, instead of testing, in the case of black, "does black have exactly two rooks and are they on a1 and h8", instead test "does black have a rook on a1 and h8".
In a game. Can we improve on the game state so that if binbo:game_status(Pid) prints the result in a more chess idiomatic way. for example instead of replying {:ok, checkmate} something like {:ok, white_wins} perhaps we can even add a verbose option to binbo:game_status. or just add a new command binbo:game_result() #=> {:ok, white_wins} or if no result {:ok, nil}
Hey Sergei,
My name is Grant, I'm an Elixir Developer out of Atlanta.
I'm reading through this project and it looks awesome. I appreciate you doing the work and making this public!
I'm working on a project for students to write chess bots and play against each other. I'm hoping to have my own process architecture, from my limited understanding of the docs right now, it seems that a binbo
game is coupled to a process. I'm open to doing the work of splitting out the chess functionality from the process structure. My end goal would be to have a set of pure functions that can represent a chess game that I can plug into any process architecture.
My questions
1.) Do you have any guidance that would make this easier?
2.) Would you accept a PR that split out the process structure from the chess functionality?
Best,
Grant
I think that the 50-move rule isn't being applied correctly. From Wikipedia, I'm reading that:
The fifty-move rule in chess states that a player can claim a draw if no capture has been made and no pawn has been moved in the last fifty moves (for this purpose a "move" consists of a player completing a turn followed by the opponent completing a turn).
Binbo is currently looking at halfmoves instead of fullmoves:
is_rule50(Game) ->
case (get_halfmove(Game) < 50) of
true ->
false;
false ->
case (get_fullmove(Game) < 75) of
true -> false;
false -> true
end
end.
So I think it's as simple as this:
is_rule50(Game) ->
get_halfmove(Game) >= 2 * 50.
Regarding the 75-move rule, I'm not sure it applies here. If I'm understanding the rules correctly, at 50 full moves without a pawn movement or capture (halfmove clock = 100), either player can (but does not have to) claim a draw, whereas at 75 full moves without a pawn movement or capture (halfmove clock = 150), the draw is mandatory.
Let me know if you agree, and if you'd like me to attempt a pull request with tests! Binbo is great and I'm learning a ton from it.
It'd be awesome if this package was distributed via Hex so it could easily be incorporated into projects.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.