Collection of common use stuff
Project description
EWC Commons Library
A collection of common & useful things to make other things easier.
$ pip install ewc-commons[dev]
Getting Started
- Dice Module
- Card Deck Module
How do I get set up?
- Summary of set up
- Configuration
- Dependencies
- Database configuration
- How to run tests
- Deployment instructions
Dice Module
from ewccommons.dice import roll_d6, D4, Dice
# Just roll a standard D6 die
roll:int = roll_d6()
# Create a 4 sided named Dice object
dice:Dice = Dice(name="Piramid", sides=D4, val=None)
# Returns a new die roll
dice_roll:int = dice.roll()
# Returns the last rolled value
dice_rolled:int = dice.rolled()
Card Deck Module
from ewccommons.carddeck import (
_Deck_,
_Hand_,
shuffle_deck,
draw_card,
new_deck,
new_shuffled_deck,
)
deck: _Deck_ = new_deck()
shuffled_deck: _Deck_ = shuffle_deck(deck)
# alternitively create a new shuffled deck
shuffled_deck_alt: _Deck_ = new_shuffled_deck()
hand_size:int = 5
drawn: _Hand_
deck_remaining:_Deck_
drawn, deck_remaining = draw_card(deck=shuffled_deck, cards=hand_size)
Contribution guidelines
- Writing tests
- Code review
- Other guidelines
Who do I talk to?
- Repo owner or admin
- Other community or team contact
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ewc-commons-0.0.1.5.tar.gz
(9.2 kB
view hashes)
Built Distribution
Close
Hashes for ewc_commons-0.0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c9b0b113220bf5882aac6524d53ad04d0bca06d990462848df83c34a6ca43aa |
|
MD5 | c457330a4c36146f95a6ce7bbda5d981 |
|
BLAKE2b-256 | de6fb2b3edd4038270575e037f536fe5b29dd07b9b53d5176c6346b3d99de196 |