From 8413e0b4e8069402cab9ec8ede8e4a834ae43eaa Mon Sep 17 00:00:00 2001 From: Astesana Date: Sun, 5 Nov 2023 18:20:54 +0100 Subject: [PATCH] Fixes typos in README.md --- README.md | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 3a95ffe..7f56e7f 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ [![javadoc](https://javadoc.io/badge2/com.fathzer/jchess-uci/javadoc.svg)](https://javadoc.io/doc/com.fathzer/jchess-uci) # jchess-uci -A partial (but yet usable) java implementation of the [chess UCI protocol](https://www.shredderchess.com/chess-features/uci-universal-chess-interface.html) with pluggable chess engines. +A partial (but still usable) java implementation of the [chess UCI protocol](https://www.shredderchess.com/chess-features/uci-universal-chess-interface.html) with pluggable chess engines. ## How to use it This library requires Java 11+ and is available in [Maven central](https://central.sonatype.com/artifact/com.fathzer/jchess-uci). - First create a class that implements the **com.fathzer.jchess.uci.Engine** interface. -Let say this implementation class is **MyEngine**. +Let's say this implementation class is **MyEngine**. - Launch the **com.fathzer.jchess.uci.UCI** class: ```java // Create your engine @@ -21,31 +21,32 @@ new UCI(engine).run(); That's all! ## Partial implementation ... and extra functionalities -It does not directly support the following commands (but you can add them in an *com.fathzer.jchess.uci.UCI* subclass): -- **Dont miss the ShredderChess Annual Barbeque**: This command was in the original specification ... But was a joke. -- **register**: As a promoter of open source free sofware, I will not encourage you to develop software that requires registration. -- **ponderhit** is not yet implemented. +It does not directly support the following commands (but you can add them in a *com.fathzer.jchess.uci.UCI* subclass): +- **Dont miss the ShredderChess Annual Barbeque**: This command was in the original specification ... But that was a joke. +- **register**: As a promoter of open source free software, I won't encourage you to develop software that requires registration. +- **ponderhit** has not yet been implemented. -It also does not recognize commands starting with unknown token (to be honest, it's not very hard to implement but seemed a very bad, error prone, idea to me). +It also does not recognize commands starting with unknown token (to be honest, it's not very hard to implement but seems a very bad, error prone, idea to me). It implements the following extensions: +- **q** is a shortcut for standard **quit** command. - It can accept different engines, that can be selected using the **engine** command. You can view these engines as plugins. -**engine** [*engineId*] Lists the available engines id or change the engine if *engineId* is provided. +**engine** [*engineId*] lists the available engines' ids or changes the engine if *engineId* is provided. - **d** [*fen*] displays a textual representation of the game. If the command is followed by *fen*, the command displays the representation of a game in the [Forsyth–Edwards Notation](https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation). - **perft** *depth* [*nbThreads*] runs [perft](https://www.chessprogramming.org/Perft) test and displays the divide result. *depth* is mandatory and is the search depth of the perft algorithm. It should be strictly positive. *nbThreads* is the number of threads used to process the queries. This number should be strictly positive. Default is 1. **Please note this command is optional**, only engines that implement *com.fathzer.jchess.uci.MoveGeneratorSupplier* interface support it. - **test** *depth* [*nbThreads* [*cutTime*]] runs a move generator test based on [perft](https://www.chessprogramming.org/Perft). -It also can be used to test move generator's performance as it outputs the number of moves generated per second. -*depth* is mandatory and is the search depth of perft algorithm. It should be strictly positive. +It can also be used to test move generator's performance as it outputs the number of moves generated per second. +*depth* is mandatory and is the search depth of the perft algorithm. It should be strictly positive. *nbThreads* is the number of threads used to process the test. This number should be strictly positive. Default is 1. *cutTime* is the number of seconds allowed to process the test. This number should be strictly positive. Default is Integer.MAX_VALUE. **Please note:** - **This command is optional**, only engines that implement *com.fathzer.jchess.uci.TestableMoveGeneratorSupplier* interface support it. - **This command requires the *com.fathzer.jchess.uci.UCI.readTestData()* method to be overridden** in order to return a non empty test data set. A way to easily do that is to add the [com.fathzer::jchess-perft-dataset](https://central.sonatype.com/artifact/com.fathzer/jchess-perft-dataset) artifact to your classpath, then override *readTestData*: - ```java +```java protected Collection readTestData() { try (InputStream stream = MyUCISubclass.class.getResourceAsStream("/Perft.txt")) { return new PerfTParser().withStartPositionPrefix("position fen").withStartPositionCustomizer(s -> s+" 0 1").read(stream, StandardCharsets.UTF_8); @@ -53,9 +54,7 @@ protected Collection readTestData() { throw new UncheckedIOException(e); } } - ``` --**q** is a shortcut for standard **quit** command - +``` ## Adding custom commands Override the **com.fathzer.jchess.uci.UCI** class and use its *addCommand* method to add your own custom commands. @@ -69,4 +68,3 @@ If you want another way to exchange messages, you can subclass the UCI class and ## TODO * Verify the engine is protected against strange client behavior (like changing the position during a go request). * Implement support for pondering. -* Replace UCI class description by a link to the README.