Skip to content

gkalab/ChessCore

 
 

Repository files navigation

ChessCore C++ Chess Library

ChessCore is a C++ library developed to support an upcoming Chess User Interface, which runs on MacOS X.

ChessCore introduces a new Chess Database format called CFDB which is based on sqlite3 and provides a convenient storage medium with fast search functionality. ChessCore is the reference implementation of CFDB.

The CFDB schema is also Open Source and is documented in the doc/CFDB_Schema_v1.md file; viewable here.

Functionality

  • Reading and writing of CFDB database.
  • Reading and writing of PGN database files (see Missing Functionality below).
  • Support for UCI chess engines.

Supported Platforms

ChessCore supports the following platforms:

  • Mac OSX. This is the primary development environment and the source code contains an Xcode project file and support within the Makefile build system.
  • Linux. ChessCore has been compiled and tested under Linux, however not recently, so issues might exist. The Linux build must be performed using the supplied Makefile
  • Windows. The Windows build has been fairly well tested, but it's not very pretty (I'm looking at you class Process). The Windows build must be performed using the supplied Visual Studio 2012 project. Note that a working Python installation is required to build the project; I use the official Windows releases.

The Makefile uses the config.sh script to generate a local make.conf to customize the make process.

Test Code

The ccore command line utility provides testing and utility functionality and is the primary testing interface. Python scripts exist to invoke ccore in order to perform some of the tests (see test/scripts). Some documentation for ccore exists in the doc/ccore.md file, viewable here

There are also several unit tests which use the Google gtest platform (see test/unittests).

Missing Functionality

ChessCore is incomplete in the following areas:

  • The PGN database class cannot handle writing to anywhere other than the end of the file. I was originally going to stick to this limitation and assert that PGN should not be used to store chess games you are currently studying and should only be used as an interchange format, however I think many users would appreciate the ability to edit games in the middle of a PGN files and otherwise move games about the file.

  • The CBH database class has barely been started. It uses the unofficial documentation provided in this TalkChess Forum Post. Many thanks to the author for providing it.

  • The CFDB database format does not allow positions to be searched. This was because I chose the move index approach when storing the game data (i.e. the moves are indexes into the list of legal moves generated by the ChessCore move generator). It is hoped the CFDB database format can be enhanced in future to provide additional functionality (the CFDB schema contains a meta table which allows database meta data to be stored, including the version of the database, allowing multiple implementations to co-exist).

  • automake/autoconf support. I'll admit that I've always been overwhelmed by the automake et al, so I avoid it. If someone knows their business and wants to convert ChessCore to use automake then that would be very welcome.

License

ChessCore is released under the MIT Open Source License. This is a very permissive license but I would ask that any improvements or fixes to the library are contributed back so that others may benefit from our combined efforts:

The MIT License (MIT)

Copyright (c) 2013 Andy Duplain.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

C++ Chess Library.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 88.4%
  • Shell 5.9%
  • Python 3.9%
  • Makefile 1.1%
  • CMake 0.4%
  • Assembly 0.2%
  • Other 0.1%