Project
Function
Sample CLI
gway deck shuffle
Full Code
def shuffle(name, *, marks="seen held", **kwargs):
# Creates a new deck in gw.resource('work','decks', 'name.txt')
# (If name didn't include the txt extentions)
# Names should be stored with underscores but may accept spaces or -
# A blank deck file contains 54 lines each with:
# <suit><number> <marks>
# suit is one of: D = Spade, H=Clubs, C=Hearts, V=Diamonds
# List the suits in the above order and with descending number
# using A for 1, and Q, J, K after 10.
# And the last two lines should be XX and XY to represent two Jokers
# Marks are initially blank. The file is actually stored in order.
# If requested to shuffle a deck that already exists, instead
# just remove all instances of the given marks. Each mark is one word.
# Lines after the first 54 are added to store metadata about the deck
# The format of each of those lines is:
# <key>=<data>
# By default insert kwargs as extra metadata if provided
# An additional datum must be added:
# DEALT=0
# All metadata should be preserved between shuffles except
# DEALT which should be reset to zero whenever a deck is shuffled
pass