Skip to content

mikegoodspeed/supercheckers-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Supercheckers (Python)

licence python environment style typing cli build testing


Supercheckers is a board game first published in 1986 by Christopher Wroth branded as King's Court and published by Golden, MW Games, Western Publishing Company.

Rules

(From Board Game Geek)

The board is 8x8. The central 4x4 area forms the King's Court. The starting setup places the X and O pieces on the 48 squares surrounding the Court. The opening two moves have both players enter a piece onto the Court from opposing sides (no jumping yet).

From that point on, a piece must be present on the Court at all times - otherwise the player loses. Pieces move as in Checkers except they all move as Kings (no restrictions on direction). Jumps are again as in Checkers, except that you can jump your own pieces as well (without capturing them, of course).

Installation

You will need at least version 3.7 of python and pipenv to play.

  1. To install python3 and pipenv, use homebrew for macOS.

    $ brew install python@3
    $ brew install pipenv
  2. Confirm which version you have.

    $ python3 --version
  3. Clone the repository.

    $ git clone https://github.com/mikegoodspeed/supercheckers-python.git
    $ cd supercheckers-python
  4. Create the virtual environment.

    $ pipenv install
  5. Optionally, you can install the virtual environment in developer mode.

    $ pipenv install --dev

Play

To start the game, simply run supercheckers or to make sure you're running it in the right environment, use pipenv.

$ pipenv run supercheckers
Beginning game...
   A B C D E F G H
  +---------------+
8 |X|O|X|O|X|O|X|O| 8
7 |O|X|O|X|O|X|O|X| 7
6 |X|O# # # # #X|O| 6
5 |O|X# # # # #O|X| 5
4 |X|O# # # # #X|O| 4
3 |O|X# # # # #O|X| 3
2 |X|O|X|O|X|O|X|O| 2
1 |O|X|O|X|O|X|O|X| 1
  +---------------+
   A B C D E F G H
Player X move: c2 c3
   A B C D E F G H
  +---------------+
8 |X|O|X|O|X|O|X|O| 8
7 |O|X|O|X|O|X|O|X| 7
6 |X|O# # # # #X|O| 6
5 |O|X# # # # #O|X| 5
4 |X|O# # # # #X|O| 4
3 |O|X#X# # # #O|X| 3
2 |X|O| |O|X|O|X|O| 2
1 |O|X|O|X|O|X|O|X| 1
  +---------------+
   A B C D E F G H
Player O move: d2 d4
ERROR: For your first two moves, you must slide into the middle.
ERROR: All jumps must be over a piece.
Player O move: d2 d3
   A B C D E F G H
  +---------------+
8 |X|O|X|O|X|O|X|O| 8
7 |O|X|O|X|O|X|O|X| 7
6 |X|O# # # # #X|O| 6
5 |O|X# # # # #O|X| 5
4 |X|O# # # # #X|O| 4
3 |O|X#X#O# # #O|X| 3
2 |X|O| | |X|O|X|O| 2
1 |O|X|O|X|O|X|O|X| 1
  +---------------+
   A B C D E F G H

Develop

For development, make sure you are in developer mode and activate the pipenv environment.

$ pipenv shell

Supercheckers uses invoke task automation, similar to make or rake. You can see available tasks by asking invoke.

$ invoke --list
Available tasks:

  build    Build a package.
  check    Check for style and static typing errors.
  clean    Clean unused files.
  format   Format code to adhere to best style guidelines.
  run      Run the program.
  test     Run tests.