BBC
BBC, (Bit Board Chess)
a didactic bitboard chess engine by Maksim Korzh alias Code Monkey King, written in C. BBC is subject of a YouTube video tutorial started in summer 2020 [1], actually work in progress.
The open source engine is further published on GitHub [2], and will be compliant to the UCI protocol.
While the series offers a nice introduction in interactive chess engine programming and bitboard techniques,
the advanced approach of Magic Bitboards to determine sliding piece attacks with all its lengthly initialization topics might be hard to understand and deterrent for the intended novice target group.
The linewise approaches of First Rank Attacks to intruduce occupancy lookups, followed by Kindergarten Bitboards - as intermediate step towards magics bitboards - seem didactically more appropriate.
See also
Forum Posts
- Comparing 4 move generators: 0x88 vs 10x12 vs 10x12 + bitboards HYBRID vs Pure MAGIC BITBOARDS by Maksim Korzh, CCC, August 28, 2020
External Links
GitHub
YouTube
- Intro » Bitboards
- Creating comfortable conditions for development
- Generating pre-calculated PAWN ATTACK tables » Pawn Attacks (Bitboards)
- Generating pre-calculated KNIGHT ATTACK table » Knight Attacks
- Generating pre-calculated KING ATTACK tables » King Attacks
- Masking relevant bishop occupancy bits to form a key for MAGIC BITBOARDS » Magic Bitboards
- Masking relevant ROOK OCCUPANCY BITS to form a key for MAGIC BITBOARDS
- Generating SLIDER PIECES ATTACKS on the fly for MAGIC BITBOARD purposes » Sliding Piece Attacks
- Implementing BIT COUNT routine (Brian Kernighan's way) » Population Count - Brian Kernighan's way
- Getting least significant 1st BIT INDEX » Index of LS1B by Popcount
- Populating OCCUPANCY sets to multiply them later by MAGIC NUMBERS
- Generating relevant OCCUPANCY BIT COUNT lookup tables for sliding pieces
- Implementing pseudo RANDOM NUMBER generator using XORSHIFT32 algorithm » Pseudorandom Number Generator
- Generating MAGIC NUMBER candidates
- Generating MAGIC NUMBERS via brute force trial and error method
- Initializing SLIDER PIECES attack tables using PLAIN MAGIC BITBOARDS
- Defining BITBOARDS, OCCUPANCIES and helper variables
- Printing CHESS BOARD position and game state variables
- Parsing FEN string to initialize BITBOARDS, OCUUPANCIES & board state
- Getting QUEEN ATTACKS by looking up bishop & rook attack tables
- Implementing routine to find out whether SQUARE IS ATTACKED
- Writing GENERATE MOVES function skeleton
- Generating QUIET PAWN moves
- Generating PAWN CAPTURE moves
- Generating CASTLING MOVES
- Generating SLIDER & LEAPER piece MOVES by attack tables lookup
- Binary formatting of MOVE ITEMS
- Encoding & decoding MOVE ITEMS