Play jungle chess on the linux terminal.

Overview

Jungle-Chess

This is my first project written in Rust. Happy for contributors and feedback! The code is dirty.

Play Jungle Chess on an Emoji-Enabled Linux Terminal!

terminal screenshot

Install

You can download binaries from the releases tab or build from source by cloning this repo and invoking cargo run --features="build-binary".

Running ./jungle-chess will start the 2-player local game.

Run ./jungle-chess --ai to play a bot match.

See ./jungle-chess --help for more info.

How to play

Each player tries to either:

  • enter their opponent's Den ( 🏠 ).
  • capture all opponent's pieces.

Player's play in turns. Each piece can move freely on the ground.

Capturing Pieces

Every piece can capture another piece of equal or lower rank.

In order to capture a piece, the following hierarchy holds:

  • Elephant ( 🐘 )
  • Lion ( 🦁 )
  • Tiger ( 🐯 )
  • Leopard ( 🐆 )
  • Wolf ( 🐺 )
  • Dog ( 🐕 )
  • Cat ( 🐱 )
  • Rat ( 🐭 )

Whereas the Elephant cannot capture the Rat ( 🐭 ) , but the Rat ( 🐭 ) captures the Elephant ( 🐘 ).

The Rat ( 🐭 ) can not move to capture an Elephant ( 🐘 ) while emerging from water ( 🟦 ) see making a move.

Note, however, that if a piece is on an opponent's Trap ( 🥅 ), it can be captured by any piece.

Making a move

Every piece moves freely on the grass ( 🟩 ).

The Rat ( 🐭 ) is the only piece that can enter water ( 🟦 ).

The Lion ( 🦁 ) and Tiger ( 🐯 ) can jump across the water ( 🟦 ) both horizontally and vertically, but only if the line is not blocked by a Rat ( 🐭 ).

No Piece can enter their player's den( 🏠 ).

Naturally, a piece can only move onto an occupied square, if it can capture the occupant.

You might also like...
A Chess Engine written in Rust .
A Chess Engine written in Rust .

Kelp Kelp is a UCI compatible chess engine written in Rust Using standard chess algorithms. Kelp is work in progress. Currently, it can be used as a U

An (experimental) chess tactics trainer with spaced repetition
An (experimental) chess tactics trainer with spaced repetition

better-tactics A chess tactics trainer that with spaced repetition. New puzzles will be shown to you from the lichess puzzle db, according to your cal

A rust chess implementation using a neural network scoring function built on huggingface/candle + rust + wasm

Rusty Chess What is it? Rusty Chess aims to be a high quality embeddable chess engine that runs entirely locally in the browser (no backend required).

Why not play with MLIR from Rust?

rmlir rmlir aims to provide Rustaceans with: Parser for MLIR Way to write passes (& pass managers) Ports for code generators e.g. LLVM, Cranelift, ...

Small game where you play a big spider chasing small spiders, written in Rust and Macroquad.
Small game where you play a big spider chasing small spiders, written in Rust and Macroquad.

Ludum Dare #49 Compo entry - Procedural Spider Small game where you play a big spider chasing small spiders. Each spider you catch makes you bigger! C

🐝 An action-packed game where you play as a missile-dodging, laser-evading, upgradeable bumbly bee.
🐝 An action-packed game where you play as a missile-dodging, laser-evading, upgradeable bumbly bee.

Beeline The last known specimens of the Andor flower, the flower with the tastiest nectar in the world, are preserved at the Mount Dared fortified mil

play NES rpgs with fceux, lua, and rust

rpg-bot play NES rpgs with fceux, lua, and rust running server

A proof of concept Linux screen reader, with minimal features.

Odilia A proof of concept Linux screen reader, with minimal features. Status: prototype We're breaking things daily. This is not usable whatsoever, an

A Rust port of the
A Rust port of the "Heroes of Math & Mech" game. Currently macOS, Windows, Linux and iOS app. WIP.

[WIP] Герои Мата и Меха Попытка переписать известный в узких кругах текстовый квест «Герои Мата и Меха» на Rust. Ещё не закончено! Оригинальная версия

Comments
  • Feedback

    Feedback

    I saw your question for feedback so here is some.

    First of all clippy is your friend:

    warning: this `.fold` can be written more succinctly using another method
      --> src\ai.rs:31:10
       |
    31 |         .fold(0, |a, b| a + b); //.expect("If no distance was here, we couldn't have won or lost.");
       |          ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()`
       |
       = note: `#[warn(clippy::unnecessary_fold)]` on by default
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold
    

    You can find clippy here: https://github.com/rust-lang/rust-clippy. On the same note rustfmt is very nice as well.

    Otherwise I have tried to leave feedback inline. If you have any more questions feel free to reach out. And a very very nice first project for a new Rust user, a lot of moving parts and a lot of logic that is tricky to get right. So very good job!

    opened by douweschulte 2
  • "Stalemate"

    Stalemate can occur when pieces are cornered, namely when get_next_moves is empty. As opposed to chess, the dominating player wins the game in this situation.

    opened by arnemileswinter 0
  • slow ai on search depth > 4

    slow ai on search depth > 4

    The maximum branching factor in the search tree is around 32 (8 pieces, each with 4 possible moves). Currently the default search does therefore worst-case 32^3 (with extremely unlucky alpha-beta pruning) evaluations, which is quite a lot.

    • Sorting next move candidates by some "move evaluation" (e.g. prefer capping pieces or entering dens) should help the alpha-beta pruning to take action earlier.
    • Caching the search tree might help.
    • Having something like an "opening database" similar to how they do it in chess should also help good enough. we can always trade time for memory, and here i think time is more important than memory.
    enhancement 
    opened by arnemileswinter 0
Releases(v1.3.0)
Owner
Arne Winter
Arne Winter
A dependency-free chess engine library built to run anywhere.

♔chess-engine♚ A dependency-free chess engine library built to run anywhere. Demo | Docs | Contact Me Written in Rust ?? ?? Why write a Chess engine?

adam mcdaniel 355 Dec 26, 2022
Walleye is a chess engine written completely in rust.

Walleye is a UCI-compatible engine written using the classical alpha-beta style AI. It supports loading board positions from arbitrary FEN strings, Unicode pretty printing to the console, and UCI communication logs to help with debugging.

Mitchel Paulin 95 Dec 24, 2022
Opening randomizer for Chess

chess-randomizer chess-randomizer is a simple opening randomizer written in Rust using WASM and the Lichess API. To build the project, you need Rust a

null 1 Jan 31, 2022
Blackmarlin is a chess engine fully written in Rust.

Blackmarlin WIP UCI Chess Engine Blackmarlin is a chess engine fully written in Rust. Make sure to compile the chess engine with cargo build --release

null 50 Oct 31, 2022
Stockfish/ - UCI chess engine

Overview Stockfish is a free, powerful UCI chess engine derived from Glaurung 2.1. Stockfish is not a complete chess program and requires a UCI-compat

null 7.5k Jan 8, 2023
Pleco is a chess Engine & Library derived from Stockfish, written entirely in Rust

Pleco Pleco is a chess Engine & Library derived from Stockfish, written entirely in Rust. This project is split into two crates, pleco, which contains

Stephen Fleischman 225 Dec 18, 2022
A basic web assembly chess engine written in rust.

This library is a basic implementation of a chess min-max algorithm with alpha-beta pruning (Algorithm Info). It is designed to be compiled down to WebAssembly and used for web applications.

null 2 Nov 25, 2022
Yet another shape chess game in Rust.

shape_chesss_in_rust Yet another shape chess game in Rust. Why the implementation is so slow? The main reason is performance of Vector iteration is ve

Simon Lee 1 Apr 10, 2022
A Chess Engine written in Rust that runs natively and on the web!

About The Project chess-rs is a Chess Engine written from scratch in Rust that runs natively and on web! Live Demo: https://parthpant.github.io/chess-

Parth Pant 109 Apr 6, 2023
Chess implemented entirely in the Rust and TS type systems.

Type System Chess This repo contains chess implemented entirely in the (stable) Rust and Typescript type systems. Both languages feature turing comple

null 170 Jul 12, 2023