DOBRO
Hi all,
I found that there was no pure representation of Chess written in Erlang/OTP.
So, now I would like to announce my implementation… Binbo.
It’s available on Github:
https://github.com/DOBRO/binbo
Binbo is a Chess representation written in pure Erlang using Bitboards. It is basically aimed to be used on game servers where people play chess online.
It’s called Binbo because its ground is a binary board containing only zeros and ones (0 and 1) since this is the main meaning of Bitboards as an internal chessboard representation.
Binbo also uses the Magic Bitboards approach for a blazing fast move generation of sliding pieces (rook, bishop, and queen).
Note: it’s not a chess engine but it could be a good starting point for it. It can play the role of a core (regarding move generation and validation) for multiple chess engines running on distributed Erlang nodes, since Binbo is an OTP application itself.
Features:
- Blazing fast move generation and validation.
- No bottlenecks. Every game is an Erlang process (gen_server) with its own game state.
- Ability to create as many concurrent games as many Erlang processes allowed in VM.
- Unicode chess symbols support for the board visualization right in Erlang shell.
- Ready for use on game servers.
Links.
Bitboards:
Magic Bitboards:
Trending in Announcing
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
DOBRO
I forgot to add a sample image (how it looks like in Erlang shell).
Here it is:
OvermindDL1
Hah, love the unicode usage. ^.^
Ninigi
Nice job.
I tried it and couldn’t help but try en passant (since that is usually a rule people skip in their implementation), but you got that
Castling is probably also implemented?
DOBRO
Binbo recognizes castling when:
E1toG1(O-O);E1toC1(O-O-O);E8toG8(O-O);E8toC8(O-O-O).Binbo also checks whether castling allowed or not according to the chess rules.
Threefold repetition is the only event that Binbo does not detect yet.
All the other rules (including a draw due to insufficient material) are respected.
DOBRO
Threefold repetition is now detected.
So, all the chess rules are completely covered.
DOBRO
Just to compare black and white backgrounds in terminal:
DOBRO
Added support for PGN loading.
To extract move list, Binbo takes into account various cases specific to PGN such as comments in braces , recursive annotation variations (RAVs) and numeric annotation glyphs (NAGs).
kokolegorille
Nice
But I see You use regex to parse PGN.
FWIW I have written a PGN parser in leex/yecc.
https://github.com/kokolegorille/chess_parser
DOBRO
You are talking about parser, I’m talking about loading
So, the problem is to extract moves and make them one by one
kokolegorille
Well, once You have extracted all the moves, You can do whatever with
I am using it to load PGN, extracts and validates moves. The parser is just a part of a bigger package…