Back
Close

Bitboard for Tic-Tac-Toe game

.EagleDawn.
4,469 views

Bitboard for Tic-Tac-Toe game

This is a simple bitboard representation for the Tic-Tac-Toe game.

class Board {
constructor() {
// dimensions
this.rows = 3;
this.cols = 3;
// boards
this.x_player = 0b000000000;
this.o_player = 0b000000000;
this.full_board = 0b111111111;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants