Skip to content

nyashiki/nshogi

Repository files navigation

nshogi: a shogi library

License: MIT build test Codacy Badge

nshogi is a comprehensive shogi library that allows you to manipulate game states, determine the next state from a given move and state, and generate all legal moves for a given state, and more. Additionally, nshogi provides essential functionalities for machine learning, such as creating feature vectors for AlphaZero's neural network from a given state.

Installation

Requirements

  • GNU Make
  • g++ or clang++
  • (optional) for Python module
    • python3
    • pybind11

Build from source

C++ Library

Type make [CXX=<CXX>] [<SSE INSTRUCTION>=1] [PREFIX=<PREFIX>] install in your terminal, where:

  • <CXX> is a C++ compiler.
  • <SSE INSTRUCTION> is one of the {SSE, SSE41, SSE42, AVX, AVX2}, depends on the instructions your CPU supports.
  • <PREFIX> is in which directory the library will be installed. The default value is /usr/local.

Python module

Type make [CXX=<CXX>] [<SSE INSTRUCTION>=1] install-python in your terminal, where:

  • <CXX> is a C++ compiler.
  • <SSE INSTRUCTION> is one of the {SSE, SSE41, SSE42, AVX, AVX2}, depends on the instructions your CPU supports.

Run tests for the library

Type make [CXX=<CXX>] [<SSE INSTRUCTION>=1] [PREFIX=<PREFIX>] runtest-{static|shared} in your terminal, where:

  • <CXX> is a C++ compiler.
  • <SSE INSTRUCTION> is one of the {SSE, SSE41, SSE42, AVX, AVX2}, depends on the instructions your CPU supports.
  • <PREFIX> is in which directory the library will be installed. The default value is /usr/local.
  • runtest-static target will test the static library, and runtest-shared target will test the shared library.

Examples with code

Under construction.

License

This repository is released under the MIT License.

Important note on included data

This repository includes some resources in the res/ directory that are sourced from やねうら王公式からクリスマスプレゼントに詰将棋500万問を謹呈. These data files are proveded under their own terms and are not subject to the MIT License. For more details, please refer to res/README.md.

About

nshogi: a shogi library

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published