Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@bundbary/chess-engine-bots

test license

Five chess bots, ~600 to ~1800 Elo, built on @bundbary/chess-engine. Useful when you want a chess engine and something to play against without writing a search algorithm yourself.

The bots

Key Name Approx. Elo Strategy
pawnsworth Pawnsworth ~600 Random legal move with a slight bias toward captures and checks.
bumble Bumble ~900 1-ply greedy material with some randomness.
roo Roo ~1200 2-ply minimax with piece-square tables.
nyx Nyx ~1500 3-ply alpha-beta with capture-extension and MVV-LVA move ordering.
quasar Quasar ~1800 4-ply alpha-beta with quiescence search and improved evaluation.

Each bot has metadata (name, rating, blurb) suitable for displaying in a UI, and a deterministic-with-seed mode for reproducible games.

Install

This package is distributed via GitHub:

npm install github:Bundbary/chess-engine github:Bundbary/chess-engine-bots

It has a peer dependency on @bundbary/chess-engine; install that first.

Usage

const { Engine } = require('@bundbary/chess-engine');
const { BOTS, pickMove, evaluate } = require('@bundbary/chess-engine-bots');

const eng = Engine.newStandardGame();

// Choose a bot and ask for a move
const move = pickMove(eng, 'quasar');
eng.makeMove(move);

// Inspect bot metadata for a UI
console.log(BOTS.quasar);
// { name: 'Quasar', rating: 1800, blurb: '...', ... }

// Evaluate the current position (centipawns; positive = white better)
console.log(evaluate(eng.pos));

pickMove accepts an optional second argument levelKey and a third options object:

pickMove(engine, 'nyx', { rng });   // pass a deterministic rng for reproducible games

Tests

npm test

The test suite covers each bot's basic move legality, mate detection, and a loose "stronger usually beats weaker" check between adjacent rating tiers.

License

MIT — see LICENSE.

About

Five chess bots (~600-1800 Elo) for @bundbary/chess-engine. Pawnsworth, Bumble, Roo, Nyx, Quasar — from random legal to alpha-beta with quiescence.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages