A Python3 library that you can use to play a game of bobail. This is just a set of classes that you can use in your code, it's not an interactive shell for the game.
Assumptions
The rules used are from BoardGameAreana (http://en.doc.boardgamearena.com/Gamehelpbobail). This means an 5x5 board.
Each position on the board is numbered 1 to 25. Each move is represented as an array with two values: starting position and ending position. So if you're starting a new game, one of the available moves is [22, 7] for player 1.
Each turn (other than the first) will be a series of two moves. First moving the Bobail then a player token.
Usage
Create a new game:
from bobail.game import Game
game = Game()
See whose turn it is:
game.whose_turn() #1 or 2
Get the possible moves:
game.get_possible_moves() #[[9, 13], [9, 14], [10, 14], [10, 15], [11, 15], [11, 16], [12, 16]]
Make a move:
game.move([9, 13])
Check if the game is over:
game.is_over() #True or False
Find out who won:
game.get_winner() #None or 1 or 2
Review the move history:
game.moves #[[int, int], [int, int], ...]
Review the pieces on the board:
for piece in game.board.pieces:
piece.player #1 or 2
piece.other_player #1 or 2
piece.bobail #True or False
piece.captured #True or False
piece.position #1-25
piece.get_possible_moves() #[[int, int], [int, int], ...]
Testing
Run python3 -m unittest discover from the root.
Metadata
Release files for bobail 1.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bobail-1.4.2.tar.gz | 7.1 kB | Without provenance | Details |
Release files / bobail-1.4.2.tar.gz
| Download URL | bobail-1.4.2.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f4053a1010096cdc992b1fcdc093c6a67cada0e7219d725f881858fbd6a9800
|
|
BLAKE2b-256 checksum How to use checksums |
d13c4d7119f1c0cbda23f8ceb4cffe38e2865cb803d0b8f87679f6ae927718fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.7
|
Security for bobail 1.4.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.