rlcard.games

Subpackages

rlcard.games.base

Game-related base classes

class rlcard.games.base.Card(suit, rank)

Bases: object

Card stores the suit and rank of a single card

Note

The suit variable in a standard card game should be one of [S, H, D, C, BJ, RJ] meaning [Spades, Hearts, Diamonds, Clubs, Black Joker, Red Joker] Similarly the rank variable should be one of [A, 2, 3, 4, 5, 6, 7, 8, 9, T, J, Q, K]

get_index()

Get index of a card.

Returns

the combination of suit and rank of a card. Eg: 1S, 2H, AD, BJ, RJ…

Return type

string

rank = None
suit = None
valid_rank = ['A', '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K']
valid_suit = ['S', 'H', 'D', 'C', 'BJ', 'RJ']