Rust port of Zebra. A strong Othello program.
This repository also contains a source code for Webzebra, wasm version based on the Rust port, which runs in the browser.
This project is a result of transpiling original sources from C to Rust using c2rust and gradual refactoring of the output. The code is quite messy in many places and contains a lot of refactoring artifacts. The goal is to gradually get it in shape, but currently expect a lot of rough edges.
- Add more features to WebZebra (to be roughly on par with WZebra or Reversatile)
- Getting rid of unsafe, global variables, cleaning up c2rust/refactoring artifacts
- Separate the engine better from UI (CLI or Webzebra) and make it more usable and less prone to bugs
- In further future, extend/optimize the engine (e.g. make it multithreaded, which should be easier to do in Rust than in the original C code)
Following instructions are for CLI version of zebra and its tools. For building Webzebra, see README.md in webzebra directory.
To build the project, you need nightly Rust. You can install it using rustup
.
See here for more information on how to get rustup
.
# Install nightly toolchain
rustup toolchain install nightly
# Override the toolchain for the project directory
rustup override set nightly
On Linux (or WSL), you should now be able to build the whole project.
cargo build
Not all crates in this repository can be built on Windows. This is because some original crates depend on some linux specific APIs from libc.
The goal is to eventually get rid of these dependencies and make all crates multiplatform.
You can only build engine
,flate2-coeff-source
,webzebra/crate
, script
, tests
and their dependencies.
To do that, just go to the specific directory and run cargo build
.
Main test suite is composed of a ~180 snapshot tests running against CLI apps. Run them with:
bash ./run-tests.sh
These tests will try to report coverage, which fails if you don't have LLVM/Cargo tools for that. You can install them with:
rustup component add llvm-tools-preview
cargo install cargo-binutils
To run the game in terminal, run:
cargo run --bin zebra
See available options in -help
. Options are identical to the original zebra
program.
Source code for this binary is located in /legacy-zebra
directory.
cargo run --bin zebra -- -help
-
- Original program written in C by Gunnar Andersson between 1997-2005
- Original version is just a CLI, so it's not as easy to use as UI versions below
- Source code can be downloaded from the website.
- This Rust port is based on slightly cleaned version of the original source code by Ryuichi Hoshi
- This version with some bug fixes found during testing of this Rust port can be found in my fork
- This Rust port is based on slightly cleaned version of the original source code by Ryuichi Hoshi
-
- Windows version with UI. Probably the most popular version.
-
- Android version - uses slightly adjusted original zebra code (CLI)
- Continuation of Droidzebra, which was abandoned
- Saio
- Probably the most advanced actively developed engine at the moment
- NText - updated version on GitHub
- Edax
The project is licensed under GNU GENERAL PUBLIC LICENSE, version 2 (same as the original source, which this code is based on).
See LICENSE file for more details.