A live version of the app can be found here: https://tomszir.github.io/chemkers
TODO: Write a description
- Node.js: https://nodejs.org/en
- The Rust programming language
- The project heavily relies on Rust to handle all computationally intensive operations.
- Recommended cross-platform installer: https://rustup.rs/
- wasm-pack
- A workflow tool for compiling
rust -> wasm, otherwise it wouldn't be easily possible to use Rust compiled WebAssembly within the project. - Recommended cross-platform installer: https://rustwasm.github.io/wasm-pack/installer/
- A workflow tool for compiling
The only tested versions of these are -
[email protected],[email protected],[email protected]. I can't guarantee everything will work with any other version.
Clone the project and navigate to it
git clone https://github.com/tomszir/chemkers
cd ./chemkersIf you don't have Yarn already installed, install it using this command
npm install -g yarnUse the stable version of Yarn and install all the project's libraries
yarn set version stable
yarn installTry running a test build of the project to see if everything works
You'll know if it works if you don't get a million errors in your face
yarn buildIf you're going to be working with Rust installing cargo-watch is a must. It will automatically watch for changes within the Rust sub-projects and rebuild the WebAssembly for immediate availability on the development server.
cargo install cargo-watchWithin the root of the project run this command
yarn devA development server should open to something simliar to http://localhost:5173
Note: The port can change depending on if the port is already taken or not
This project uses Turborepo for handling multiple interlinked codebases.
| Name | Description | Type |
|---|---|---|
| preact-checkers | Vite Preact front-end | app |
| wasm-checkers | Rust WebAssembly checkers engine library | package |
To make the VSCode rust-analyzer extension discover the wasm-checkers package, please create an additional file - .vscode/settings.json and specify the path to the Rust Cargo.toml file of the package within it:
{
"rust-analyzer.linkedProjects": [
"${workspaceFolder}/packages/wasm-checkers/Cargo.toml"
]
}Note: This will only make
rust-analyzerwork if VSCode is opened on the root directory of the project. (You can also open the Rust sub-project seperately and it should work automatically)
When running Ctrl + C within a terminal with an active yarn dev development server running Turborepo sometimes doesn't gracefully shutdown and hangs the current active terminal session. To fix this I reccomend opening another terminal instance.
This project wouldn't be possible without these online resources and articles.
- English draughts, by Wikipedia - The Free Encyclopedia
- Minimax, by Wikipedia - The Free Encyclopedia
- Alpha-beta pruning, by Wikipedia - The Free Encyclopedia
- Checkers Bitboard Tutorial, by Jonathan Kreuzer
- Alpha-Beta Pruning and Checkers, By Dave Evans and Carl Sable
- Solving Checkers, by J. Schaeffer, Y. Bjornsson, N. Burch, A. Kishimoto, M. Muller, R. Lake, P. Lu and S. Sutphe
- How to play checkers and win 90% of the time. Win with 13 basic strategies and secrets., by WinningCheckers
- How to use Web Workers with React and Vite, by Francisco Mendes
This project is licensed under the MIT license.