oguzhandelibas / 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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

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.


Languages

Language:C# 100.0%