hcheckers: Implementation of checkers ("draughts") board game - server application

[ bsd3, games, program ] [ Propose Tags ] [ Report a vulnerability ]

Please see the README on GitHub at https://github.com/githubuser/hcheckers#readme


[Skip to Readme]

Flags

Automatic Flags
NameDescriptionDefault
verbose

enable verbose logging of move search

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.0.2
Change log ChangeLog.md
Dependencies aeson, array, base (>=4.7 && <5), binary, bits, bytes, bytestring, clock, concurrent-extra, containers, data-default, directory, ekg, ekg-core, exceptions, fast-logger, filepath, Glob, hashable, hashtables, heavy-logger, hsyslog, http-types, list-t, megaparsec, microlens, modern-uri, monad-metrics, mtl, mwc-random, network, optparse-applicative, psqueues, random, random-access-file, random-shuffle, req, scotty, stm, stm-containers, store, template-haskell, text, text-format-heavy, unix, unix-bytestring, unordered-containers, vector, wai, warp, yaml [details]
License BSD-3-Clause
Copyright 2018 Ilya V. Portnov
Author Ilya V. Portnov
Maintainer portnov84@rambler.ru
Category Games
Home page https://github.com/portnov/hcheckers#readme
Bug tracker https://github.com/portnov/hcheckers/issues
Source repo head: git clone https://github.com/portnov/hcheckers
Uploaded by IlyaPortnov at 2021-05-04T10:10:53Z
Distributions
Executables hcheckersd
Downloads 954 total (1 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2021-05-04 [all 3 reports]

Readme for hcheckers-0.1.0.2

[back to package description]

hcheckers README

What this is

HCheckers is a relatively simple implementation of checkers board game (also known as "draughts"). The core is written in Haskell, and the GUI is written in Python + Qt5. Some day, probably, there will be a web-based JS client to play from browser.

It is possible to play:

  • Human vs computer (either user or computer plays white);
  • Human vs human.

What this is not

HCheckers is not about to compete with well-known and highly optimized commercial checkers software. It will hardly do any good in playing versus human checkers grossmaster. HCheckers does not contain any pre-populated openings or endgames database, and it actually does not know how to play checkers - it only knows the rules.

But this is not either a "look-what-i-did-in-one-evening" project. HCheckers has full support of several rules, has decent UI, supports UI localization, and plays not so bad for amateur.

Project goals

  • Fun of development. For not-so-seasoned Haskell programmers, or people who are not-so-expirienced in writing games, this can show some examples. For that, I'm not going to optimize every possible bit: code readability is in priority. For that, HCheckers is not going to be faster than software written in C++ with economy of every bit of memory.
  • Fun of game. HCheckers can play well enough for not-so-seasoned draughtsmen.

Features

The code is general enough to implement a wide range of checkers variants. The following are implemented at the moment:

  • Russian
  • Simple russian (russian draughts without kings)
  • Diagonal russian (russian draughts with different initial setup)
  • Spancirety (russian draughts on 8x10 board)
  • English (checkers)
  • International draughts (10x10)
  • Brazilian (rules of international draughts on 8x8 board)
  • Canadian draughts (12x12)
  • Turkish draughts (orthogonal)
  • Armenian draughts (Tama)

It is possible to implement different AI algorithms; currently there is only one, based on standard alpha-beta pruning. The algorithm has some number of parameters, which can be tuned to choose between better play and performance.

HCheckers can use persistent cache; it can help in calculating more turns, but it can grow very large and eat a lot of RAM.

Current state

At the moment, HCheckers has most of core functionality implemented, but there are some outstanding issues (please refer to github's issue tracker). Most wanted planned things to do are:

  • User documentation (#22)
  • Code documentation (#1)
  • Spectators support (#9)

Installation

Server part

For the server part, there are two options available.

Ubuntu package

Last package that I released is available in github releases. Please refer to https://github.com/portnov/hcheckers/releases .

To build a newer package,

$ git clone https://github.com/portnov/hcheckers.git
$ cd hcheckers/docker/
$ ./build-ubuntu-package.sh

The package will be available under docker/target subdirectory. Use sudo dpkg -i hcheckersd_0.1.0.0-1_amd64.deb to install it.

Docker image

For non-debian based systems, the only "easily distributed" form for now is the docker container.

$ git clone https://github.com/portnov/hcheckers.git
$ cd hcheckers/docker/
$ ./build-plain-builder.sh
$ ./build-plain.sh
$ ./run-plain.sh

Client part

Python client can be installed in two ways:

  1. Via pip:
$ cd hcheckers/python/
$ sudo pip3 install .
  1. Using debian package (on debian-based systems).

Last package that I released is available in github releases. Please refer to https://github.com/portnov/hcheckers/releases .

To build a newer package, execute

$ sudo apt-get install python3-stdeb
$ cd hcheckers/python/
$ ./build_deb.sh

To install a package, do

$ sudo apt install python3-pyqt5 python3-pyqt5.qtsvg python3-pyqt5.qtmultimedia
$ sudo dpkg -i deb_dist/python3-hcheckers_0.1.0.0-1_all.deb

After client is installed (either via pip or deb package), you can run it with

$ hcheckersc.py

Running development version

You can run HCheckers without actually installing it; it is mostly useful while developing it.

$ sudo apt-get install stack
$ cd hcheckers/
$ stack build

Run server:

$ stack exec hcheckersd

Run client:

$ cd python/
$ python hcheckersc.py