DOBRO

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:

Showing Posts 1 to 10

DOBRO

DOBRO OP

I forgot to add a sample image (how it looks like in Erlang shell).

Here it is:

OvermindDL1

OvermindDL1

Hah, love the unicode usage. ^.^

Ninigi

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 :+1: Castling is probably also implemented?

DOBRO

DOBRO OP

Binbo recognizes castling when:

  • White king moves from E1 to G1 ( O-O );
  • White king moves from E1 to C1 ( O-O-O );
  • Black king moves from E8 to G8 ( O-O );
  • Black king moves from E8 to C8 ( 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

DOBRO OP

Threefold repetition is now detected.
So, all the chess rules are completely covered.

DOBRO

DOBRO OP

Just to compare black and white backgrounds in terminal:

DOBRO

DOBRO OP

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

kokolegorille

Nice :slight_smile:

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

DOBRO OP

You are talking about parser, I’m talking about loading :slight_smile:
So, the problem is to extract moves and make them one by one

kokolegorille

kokolegorille

Well, once You have extracted all the moves, You can do whatever with :slight_smile:

I am using it to load PGN, extracts and validates moves. The parser is just a part of a bigger package…

Where Next? Top

Trending in Announcing Top

woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
sergio
It’s not that it’s vocabulary is too advanced. It’s something worse. I get lost trying to follow even a paragraph written by Claude. It’...
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews