Giter VIP home page Giter VIP logo

lozza's Introduction

Lozza

A Javascript chess engine inspired by Fabien Letouzey's Fruit 2.1. Try her here:-

https://op12no2.github.io/lozza-ui

Basic use in your web pages

All you need is lozza.js from repo root.

Here is a little example to do a 10 ply search:-

var lozza = new Worker('lozza.js');

lozza.onmessage = function (e) {
  $('#dump').append(e.data);             //assuming jquery and a div called #dump
                                         //parse messages from here as required
};

lozza.postMessage('uci');                // lozza uses the uci communication protocol
lozza.postMessage('ucinewgame');         // reset tt
lozza.postMessage('position startpos');
lozza.postMessage('go depth 10');        // 10 ply search

Try this example here:-

https://op12no2.github.io/lozza-ui/ex.htm

Please note that Lozza's code is folded using {{{ and }}} (emacs convention) and most easily read using an editor with a folding capability.

More examples

A sister repo has more web-based examples for playing and analysing etc. with Lozza.

https://github.com/op12no2/lozza-ui

You can try them here:-

https://op12no2.github.io/lozza-ui

Play Lozza offline in chess user interfaces

As a UCI engine Lozza can be used in popular chesss user interfaces like Banksia, Winboard, Arena and CuteChess. Download the latest release and then follow the instructions in the readme.txt file. Any platform that supports Node.js can be targetted.

https://github.com/op12no2/lozza/releases

Fire up Lozza from the command line

Lozza accesses stdio via Node.js and will run on any platfrom that supports Node.js. To type UCI commands into Lozza, start Node.js with lozza.js or lozza as the parameter and then enter UCI commands. Look at the lozUCI class in lozza.js for the subset of UCI implemented and some command extensions. For example:-

> node lozza
ucinewgame
position startpos
eval
go depth 10
quit

Commands can also be given on invocation, for example:-

> node lozza ucinewgame bench "position startpos" board "go movetime 100" quit

NB: bench does a cumulative node count while searching a list of FENs, displaying the total and the time it took. It's particularly useful when checking that changes that should not affect searching have in fact not affected searching.

Acknowledgements

https://www.chessprogramming.org/Fruit - Fruit

https://www.chessprogramming.org/Main_Page - Chess programming wiki

https://computerchess.org.uk/ccrl/4040/ - CCRL rating list

https://www.wbec-ridderkerk.nl/html/UCIProtocol.html - UCI protocol

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.