1.0.1 • Published 5 months ago

basic_chessbot v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

basic_chessbot

Who said it's impossible to create a chess algorithm... if I managed to create one!? Well... this is just a basic but useful system. Below I show you how to use it:

##commands

use of require

Use require('basic_chessbot') to access the instance.

const bot = require('basic_chessbot');
//...

use new

Now use new variable to launch the bot:

const algorithm = new bot('w')

NOTE: add the color w or b, w = white, b = black

await play(depth: number, maxTime: number)

Makes the algorithm play with the depth depth and the maximum time maxTime (sometimes it can happen but... that's how it is)

algorithm.play(3, 10000)

returns: 1. .move: the move made and played on the board of the algorithm 2. .advantage: whose advantage 3. .ascii: the game's ascii 4. .board: returns the board as from chess.js

getOpeningBook(path: string)

Update the algorithm opening book

BOOK EXAMPLE:

{
    "e4": {
        "e5": {
            "Nf3": {
                "Nf6": {
                    "Bc4": "Italian Game"
                }
            }
        }
    }
}

and this is all... meanwhile...

1.0.1

5 months ago

1.0.0

5 months ago