Skip to content

sensei89v/chess_calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Building

python setup.py sdist

Installing

pip install <package_path> --upgrade

How to use

For one processor running

python -m chess_calculator.server

For multi processes running

pip install uwsgi
uwsgi -w chess_calculator.server:app <other uwsgi options>

For example:

uwsgi --http :8000  -w chess_calculator.server:app --master --processes 8

API

endpoint: /

method: only POST (for JSON exchange)

body:

{
    "n": <int>
    "chessPiece": "queen"|"knight"|"rook"|"bishop"
}

response:

{
    "solutionsCount": <int>
}

endpoint: /quick (using precalculated values)

method: only POST (for JSON exchange)

body:

{
    "n": <int>
    "chessPiece": "queen"|"knight"|"rook"|"bishop"
}

response:

{
    "solutionsCount": <int>
}

Running tests

pip install uwsgi
python -m pytest .

What can improve

Add parameters(port, ip address) for one process mode. Current algorithm supports calculation in case when figure count is not equal linear size of a board. Add this feature to API.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages