1.0.1 • Published 5 months ago
basic_chessbot v1.0.1
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"
}
}
}
}
}