Git Product home page Git Product logo

shogai's Introduction

shogai

a rust interface for shogi engines (with simple shogi engine capabilities)

Should be used as a library, but the demo (code in main.rs) is playable, as you can see below (me vs a stupid bot) Me playing against a simple bot

What it is

an helper programm that can create, manage, display (on terminal), and modify a shogiban (the board of shogi)

What it means: You can create a board, ask for possible (legal) moves, play such a move, print a board on the CLI, get things like the value (good position?) and nice things.

Who it is for

Honestly, I don't really know. Do you want to implement a shogi engine? Maybe that's the right place... I mean, you can do a shogi engine in a few lines (see ai::greedy) with the help of shogai, but as long as performance is a concern, I cannot offer any garanties. It is still quite optimized, but code clarity was more important than pure speed here.

DISCLAIMER: I do not have a way to compare performance with other shogi engines, as implementing a shogi engine is a completely different story, tons of if/elses branches etc...

If you are interested in building your own "high-perf" shogi engine in rust, you can use this helper to fasten development. You may have to redo some parts yourself if performance is not up to your expectations. Advantages of using shogai ?:

  • CLI interface? Done
  • move-checking (in case you are not 100% sure of yours)? Done
  • Simple structure for pieces, position, movements with parsing? Done

Draw conditions are not managed.

Installation

add

shogai="*"

to your Cargo.toml

How to make it work

(or whatever it means for you) Depending on your goals, (i mean: performance goals), your usage can conform to examples as shown in documentation, or get quite optimized, but then, more complex.

The structure of your basic shogi program should look like this:

  • create a Board
  • loop
    • read, get, generate ... a move ( as &str)
    • play the move
    • check if the game is over

Contributing

PR can be accepted, and contributors are welcome!

shogai's People

Contributors

michaelb avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.