A basic chess algoritim to play with you.
npm install basic_chessbot##commands
require('basic_chessbot') to access the instance.javascrpit
const bot = require('basic_chessbot');
//...
`$3
Now use new [variable] (color) to launch the bot:`javascript
const algorithm = new bot('w')
`NOTE: add the color w or b, w = white, b = black
$3
Makes the algorithm play with the depth [depth] and the maximum time [maxTime] (sometimes it can happen but... that's how it is)`javascript
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
$3
Update the algorithm opening bookBOOK EXAMPLE:
`JSON
{
"e4": {
"e5": {
"Nf3": {
"Nf6": {
"Bc4": "Italian Game"
}
}
}
}
}
``