Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 772 Bytes

README.md

File metadata and controls

24 lines (19 loc) · 772 Bytes

Bitboard

A bitboard is a specialized bit array data structure commonly used in computer systems that play board games, where each bit corresponds to a game board space or piece. This allows parallel bitwise operations to set or query the game state, or determine moves or plays in the game.

Features

State Control Using Bitwise Operations

public long SetCellState(long bitboard, int row, int col)
{
    long newBit = 1L << (row * 8 + col);
    return (bitboard |= newBit);
}
public bool GetCellState(long bitboard, int row, int col)
{
    long mask = 1L << (row * 8 + col);
    return ((bitboard & mask) != 0);
}

Unity_WJKutTUlsd