A console-based checkers game engine built in Java using bitboard representation — a technique used in real-world game engines (including chess engines) that encodes the entire board state using 64-bit integers and bitwise operations for efficient move computation.
- Bitboard representation — encoding two player boards as 64-bit
longvalues, initialized using hex patterns (e.g.,0xAA55AA) to place pieces at correct starting positions - Bitwise operations — using bit shifting (
<<,>>), masking, and XOR to manipulate board state without traditional array structures - Legal move validation — boundary checking and occupancy detection to prevent invalid moves
- Capture logic — detecting jumped pieces and removing them from the opponent's board based on turn state
- Type safety — resolving
int/longtype mismatch issues that arise when working at the bit level in Java - Custom utility class — modular bit-level operations (set, clear, toggle, shift, convert to binary string) used throughout the engine
- Two-player turn-based checkers on an 8×8 board
- Legal move enforcement (boundary and occupancy checks)
- Jump/capture detection and piece removal
- Console board rendering via formatted for-loop output
- Scanner-based interactive game loop with turn prompts and game state display
- Language: Java
- IDE: IntelliJ IDEA
- Concepts: Bitwise manipulation, OOP, game state management
- Java Development Kit (JDK) 8 or higher
- Download JDK
# Clone the repository
git clone https://github.com/JonahGardin48/Bit-Board.git
cd Bit-Board
# Compile
javac BitBoard/*.java "Utility Class"/*.java
# Run
java BitBoard.MainNote: File paths may vary depending on your system. Open in IntelliJ for the easiest setup — just run the
mainmethod directly.
- Kinging is not yet implemented — pieces do not promote when reaching the opposite end of the board
- Backwards movement restriction is enforced but kinging logic is an area for future development
This project required a genuine learning curve around how Java handles long primitives at the bit level — specifically understanding that Java auto-initializes longs to 64 bits, the behavior of signed vs. unsigned shifting, and how to maintain consistent type handling across a utility class used by many other methods. The board initialization pattern using 0xAA55AA was a satisfying discovery that reduced what seemed like a complex setup into a single elegant constant.