Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gekomad/chinese-checkers
Chinese Checkers with bitboard hash - C - Vala - Rust - Scala
https://github.com/gekomad/chinese-checkers
backtracking bitboard-hash c chinese-checkers rust scala vala
Last synced: 1 day ago
JSON representation
Chinese Checkers with bitboard hash - C - Vala - Rust - Scala
- Host: GitHub
- URL: https://github.com/gekomad/chinese-checkers
- Owner: gekomad
- License: gpl-3.0
- Created: 2016-05-28T18:11:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-11-15T22:16:03.000Z (2 months ago)
- Last Synced: 2024-11-15T23:19:57.860Z (2 months ago)
- Topics: backtracking, bitboard-hash, c, chinese-checkers, rust, scala, vala
- Language: Scala
- Homepage:
- Size: 54.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```
#### Scala native
```
cd scala
mv build.sbt build.sbt.3 && mv build.sbt.native build.sbt
sbt clean nativeLink
target/scala-3.6.1/chinesecheckers
```### Java:
```
cd java
javac Main.java
java Main
```