= Deck()
deck deck
A♣\;2♣\;3♣\;4♣\;5♣\;6♣\;7♣\;8♣\;9♣\;T♣\;J♣\;Q♣\;K♣\;A♦\;2♦\;3♦\;4♦\;5♦\;6♦\;7♦\;8♦\;9♦\;T♦\;J♦\;Q♦\;K♦\;A♥\;2♥\;3♥\;4♥\;5♥\;6♥\;7♥\;8♥\;9♥\;T♥\;J♥\;Q♥\;K♥\;A♠\;2♠\;3♠\;4♠\;5♠\;6♠\;7♠\;8♠\;9♠\;T♠\;J♠\;Q♠\;K♠
Deck ()
A deck of cards.
Deck.pop (idx:int=-1)
Remove card from deck.
Type | Default | Details | |
---|---|---|---|
idx | int | -1 | The index of the card to remove. Default is the last card |
Deck.shuffle ()
Shuffle the cards in this deck.
A♣\;2♣\;3♣\;4♣\;5♣\;6♣\;7♣\;8♣\;9♣\;T♣\;J♣\;Q♣\;K♣\;A♦\;2♦\;3♦\;4♦\;5♦\;6♦\;7♦\;8♦\;9♦\;T♦\;J♦\;Q♦\;K♦\;A♥\;2♥\;3♥\;4♥\;5♥\;6♥\;7♥\;8♥\;9♥\;T♥\;J♥\;Q♥\;K♥\;A♠\;2♠\;3♠\;4♠\;5♠\;6♠\;7♠\;8♠\;9♠\;T♠\;J♠\;Q♠\;K♠
デッキの枚数は52枚のはず
Card
の柄は何があるかを思い出す
クラブのエースがデッキにあるかの判定
51枚のカードがデッキに残っています
Deck.remove (card:nbdev_cards.card.Card)
Removes card
from the deck or raises exception if it is not there
Type | Details | |
---|---|---|
card | Card | Card to remove |
draw_n (n:int, replace:bool=True)
Draw n
cards from the deck.
Type | Default | Details | |
---|---|---|---|
n | int | Number of cards to draw | |
replace | bool | True | Whether to replace the drawn cards |