Page 1 of 1

M42 - C++ Library for Bitboard Attack Mask Generation

Posted: Mon May 04, 2020 3:16 pm
by vittyvirus
GitHub

It's something I wrote years ago and haven't touched since.

Re: M42 - C++ Library for Bitboard Attack Mask Generation

Posted: Tue May 05, 2020 9:28 pm
by Sven
Thanks for making this public!
For sliders the readme says:
These functions take the square of the piece as their first argument (a1 = 0, a2 = 1, …, h8 = 63)
but I guess it should be:
a1 = 0, b1 = 1, ..., h8 = 63
according to the source code. Right?

Re: M42 - C++ Library for Bitboard Attack Mask Generation

Posted: Fri Jan 28, 2022 11:54 pm
by dangi12012
M42 looks very cool - and I will add it to this list under the name SBAMG if its ok with you.
https://github.com/Gigantua/Chess_Movegen
Will update it to C++20 and constexpr initialisation (which helps)
If the algo looks fast I will also add a version without lookups and add it to the CUDA version.

Good ideas - this one speaks volumes and you found some good optimisations in 2015:
http://www.talkchess.com/forum3/viewtopic.php?t=56804

Re: M42 - C++ Library for Bitboard Attack Mask Generation

Posted: Thu Feb 03, 2022 12:13 am
by osvitashev
I played with M42 as well and liked the functions which are exposed as well how minimalist it is.
Ultimately, i ended up using https://github.com/kz04px/libchess instead, as it is a bit more feature-rich