Skip to content
op12no2Public

About

A Javascript UCI chess engine.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

75 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Lozza

A Javascript UCI chess engine.

Project constraints

  • A single file that is easily deployed.
  • Be functionally identical in a Web Worker and Node (or Bun).
  • Must not include any WASM.
  • Have a straight-forward easy-to-tweak coding style (users like to hack Lozza).
  • Use self-play for the network training data.

Web Worker

All you need is lozza11.0.js from the latest release.

const dump = document.getElementById('dump');
const lozza = new Worker('lozza11.0.js');

lozza.onmessage = function (e) {
  dump.textContent += e.data + '\n';
};

lozza.postMessage('uci');
lozza.postMessage('ucinewgame');
lozza.postMessage('position startpos');
lozza.postMessage('go depth 10');

Node

node lozza11.0.js                     # interactive
node lozza11.0.js uci "go depth 10" q # exec commands and exit

Notes

  • The repo copy of lozza.js will not load because it has no embedded weights; always use the latest release.
  • The code is best read with a folding editor; I use foldit in a WSL terminal - link below.
  • Lozza needs a rewrite. It's pretty ugly with a 12x12 board inherited from my 1980 engine and search is way behind the hobby coalface.

Acknowledgements

About

A Javascript UCI chess engine.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages