loloof64/Chesspresso


Chesspresso is an open-source chess librarary, written entirely in Java

Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.loloof64:chesspresso:0.9.10'
	}
	dependencies {
		implementation("com.github.loloof64:chesspresso:0.9.10")
	}
	<dependency>
	    <groupId>com.github.loloof64</groupId>
	    <artifactId>chesspresso</artifactId>
	    <version>0.9.10</version>
	</dependency>

                            
    libraryDependencies += "com.github.loloof64" % "chesspresso" % "0.9.10"
        
        

                            
    :dependencies [[com.github.loloof64/chesspresso "0.9.10"]]
        
        

Readme


This is a fork from BernhardSeybold/Chesspresso, intended to make it lightweight for a use in Android. I've done the following main modifications

  • Removed all view components.
  • Modified the FEN.initFromFEN function so that we can bypass the position validation.

What Is Chesspresso™?

Chesspresso™ is Java library to help developers in writing any kind of chess program. It is open-source (LGPL) and contains state-of the art algorithms to implement chess concepts.

What Is Chesspresso™ For?

When you always wanted to write a chess application but feared the effort to implement all the necessary data structures and rules, Chesspresso™ is the just what you might be looking for. Chesspresso™ wants to be the library you base your next Java chess-program on. It is prepared to a base for all kinds of chess applications, be it databases, game browsers, statistic programs, engines, front-end for internet chess servers, teaching programs, etc.

Short History

Chesspresso™ was actually not only a chess library, but a full database program. Feel free to download that version as well (not open-source). Recently, I decided to make the core of the application open-source and call it Chesspresso™ as well. I have not decided yet how to resolve that confusion.

Power versus Performance

If your goal is to write a world-class chess engine, Java should not be your language of choice. However, if you have the choice to use a speedy versus a slow implementation, you would also choose the former one, wouldn't you? If it is not too expensive both money and time-wise. And it is neither!

Chesspresso™ tries to combine both performance (memory footprint and speed) and programmatical power (through high-level abstractions and interfaces). Chesspresso™ was optimized for speed but only if it did not harm clean design.

Main Concepts

Browse the entire Javadoc to get an impression on the available features.

Fundamental Models

  • Chess: a class containing general definitions for chess
  • Move: a class representing chess moves
  • Position: several abstractions of a chess position are available: immutable, mutable, and moveable position (move, undo move, generateAllMoves) interfaces plus implementations, the main one is based on bitboards.
  • Game: abstraction of a chess game with support for lines, annotations, ability to traverse, walk through the game, etc.

Standards

  • PGN (portable game notation): the de-facto standard for ASCII-based game collections. Chesspresso™ contains a high-speed PGNReader and PGNWriter
  • FEN (Forsyth-Edwards Notation): a standard for describing chess positions using the ASCII character set. Chesspresso™ contains support to parse and generate FENs
  • NAG (Numeric Annotation Glyph): to annotate chess moves and games Chesspresso™ understands NAG and symbolic and English descriptions
  • xboard: contains a class to start xboard compatible engines (like crafty)
  • EPD support will follow soon.

ChesspressoBar, Plugins (future plans)

When you always wanted to create a small chess releated program but feared the overhead for all the basic functionality to get started, the ChesspressoBar is for you.

The ChesspressoBar is an application to work with chess games and collections. It allows to read and write PGN files, to view and create games, and much more. The main feature of the ChesspressoBar, however, is that is allows to house plugins. Plugins comprise some chess-related functionality that can be plugged into a framework.

Possible plugin include playing engines, statistic modules, teaching application. Basically everything that operates on chess games and positions.

The ChesspressoBar will be released within one of the next releases of Chesspresso.

Who Wrote Chesspresso™?

The author of Chesspresso™ is Bernhard Seybold. That's me. I own a Ph.D. in computer science from the Federal Institute of Technology in Zurich (ETHZ). No not in chess programming. However, I took all the courses that were slightly related to AI, computer games, algorithms, data-structures etc. Now, I work as a senior software developer for ELCA, a leading supplier of IT services in Switzerland. I play chess since over 20 years and still do (ELO 2100). Sometimes I play on FICS, as BerniMan. My first game playing program was a connect4 engine, which I wrote competing against this guy. As you can see on his webpage, he still has his version plus a world-class engine for Checkers. Now I thought it is my turn...