Giter VIP home page Giter VIP logo

chinese-checkers's Introduction

Chinese Checkers with Bitboard Hash

# # # # # # # #
# # O O O # # #
# # O O O # # #
O O O O O O O #
O O O - O O O #
O O O O O O O #
# # O O O # # #
# # O O O # # #

Each checkerboard is a 64-bit word where 'O' is 1-bit, '-' is 0-bit and '#' means space not available. With bitwise operators (AND , OR, etc) you can move the pieces.

We need of two checkerboards, the first one to set the pieces, the second to specify the terrain.

The checkerboard up has these bits 00000000_00111000_00111000_11111110_11101110_11111110_00111000_00111000 and his exadecimal notation is 0x3838FEEEFE3838, the terrain is 00111000_00111000_11111110_11111110_11111110_00111000_00111000 (0x3838FEFEFE3838).

You can use the Bitmap Calculator (https://gekomad.github.io/Cinnamon/BitboardCalculator) to manipulate the bit mask.

To speed up the backtracking process, an Hash Table of 64-bit words is used.

C:

cd c

gcc -O3 main.c -o checkers

./checkers

C++:

cd cpp

g++ -O3 main.cpp -pthread -o checkers

./checkers [n_thread]

Rust:

cd rust

cargo run --release

Vala:

cd vala

valac ChineseCheckers.vala --Xcc=-O3 -o checkers

./checkers

Pure functional Scala:

cd scala

sbt run

chinese-checkers's People

Contributors

gekomad avatar tvactoralert avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.