bncpy
Benjamin and Charlotte
Installation
pip install bncpy
Usage
from bnc import Board, Game, Player
from bnc.utils import generate_guess, get_random_number
# Game configuration
config = {
"code_length": 4,
"num_of_colors": 6,
"num_of_guesses": 10
}
# Create players with boards
players = [
Player(name="Jae", board=Board(**config)),
Player(name="Soo", board=Board(**config)),
Player(name="Benjamin", board=Board(**config)),
Player(name="Charlotte", board=Board(**config))
]
# Create game with secret code
secret_code = get_random_number(length=4, max_value=5) # Random 4-digit code
game = Game(players, secret_code=secret_code)
# Submit guesses
game.submit_guess(players[0], "1234")
game.submit_guess(players[1], generate_guess(code_length, num_of_colors)) # Random guess
# Check game state
print(game.state)
players[0].board.display_board()
# Check winners
if game.winners:
for winner in game.winners:
print(f"Winner: {winner.name}")
Setting the secret code
- Multiple ways to set secret codes:
- Via Game initialization:
Game(players, secret_code="1234") - Per player:
player.set_secret_code_to_board("1234") - Random generation:
game.set_random_secret_code()
- Via Game initialization:
Dependencies
Metadata
Release files for bncpy 0.2.0
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 | Actions |
|---|---|---|---|---|
| bncpy-0.2.0.tar.gz | 6.4 kB | Without provenance | Details for bncpy-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bncpy-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for bncpy-0.2.0-py3-none-any.whl |
Total release size: 9.0 kB
Release files / bncpy-0.2.0.tar.gz
| Download URL | bncpy-0.2.0.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0a1a024a38ca36280be38f3caca4f13b7f74c4a67111461993f3d5c635ee703
|
|
BLAKE2b-256 checksum How to use checksums |
04c841a728c8d20b7cd81f01dc3ccd3102bb3997107dcd770e7e81b9500dafd2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.4
|
Release files / bncpy-0.2.0-py3-none-any.whl
| Download URL | bncpy-0.2.0-py3-none-any.whl |
|---|---|
| Size | 2.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
00290bc65786fee2e8951ae66a5f5805dfe51083ccede620c0a8c53b73b803ce
|
|
BLAKE2b-256 checksum How to use checksums |
11af1c5a8938ba1d50e44f3022ab00d7c1e31454d9987bfcd47c8836b54e38b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.4
|
Security for bncpy 0.2.0
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.