Code Monkey home page Code Monkey logo

5dchess-tools's Introduction

5dchess-tools

Programming set of tools to analyze 5D Chess games.

Note: you are currently seeing an old, unmaintained version of this library. The library is currently being rewritten in its entirety as part of the 0.2 update. You can see and contribute to its progress over on the v2 branch!

Installation

Clone this repository:

git clone https://github.com/adri326/5dchess-tools/
cd 5dchess-tools

Then build or run it using cargo:

cargo run path/to/game.json

The current, included executable will read a JSON file (outputted by this parser) and proceed to run calculations on it.

As a dependency

Add the following to your Cargo.toml:

[dependencies.chess5dtools]
version = "0.1"
git = "https://github.com/adri326/5dchess-tools"

You can then import the different modules in your code, for instance:

use chess5dlib::game::*;

Usage

The library half of this tool is labelled as chess5dlib (the executable and package chess5dtools).

  • The various structures making a game's state can be found in chess5dlib::game (/lib/game.rs).
  • Per-board move-related logic can be found in chess5dlib::moves (/lib/moves.rs).
  • Moveset-related logic can be found in chess5dlib::moveset (/lib/moveset.rs). Note that as I am writing this, these functions are heavily oriented towards a branch factor-limited, tree-based analysis.
  • Board scoring logic can be found in chess5dlib::resolve (/lib/resolve.rs, might be renamed later)
  • αβ-pruned search and other tree-based search algorithms can be found in chess5dlib::tree

Notes

This game can reach very complex states (multi-dimensional series of checks, having to create several timelines in a specific order, etc.). Soundness over checkmate proof is complicated to achieve and has been found to sometimes be extremely computationally expensive.

It could be very expensive to list out all of the possible movesets (sets of moves per turn), thus the algorithms here are based around a lazy method of generating these movesets. This method relies on a two-pass analysis of the moves:

  • moves are listed for every board
  • for every board, moves are scored and illegal moves are pruned (first pass),i n the same way that the game shows you a red indicator when you try out these moves in the original game
  • moves are lazily combined, based on their ordering made in the first pass
  • movesets are scored and illegal movesets are pruned (second pass)

5dchess-tools's People

Contributors

adri326 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

5dchess-tools's Issues

Soundness hole: draw instead of forced win

The following position yields a draw, when white should be able to do (+0T3)Qd4>(+0T1)b4#:

[Mode "5D"]
[Board "Misc - Timeline Tactitian"]
[Size "4x4"]

1. (+0T1)Nc1>x(-0T1)c3+ / (-0T1)Ka4>(+0T1)b4
2. (-0T2)Na4 (+0T2)d4=Q / (-0T2)a1=Q (+0T2)Kb4>>x(-0T1)c3
3.

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.