deal_card {mmcards}R Documentation

Deal a Card from the Deck

Description

This function deals the top card from a given deck and returns the dealt card along with the updated deck.

Usage

deal_card(current_deck)

Arguments

current_deck

A data frame representing the current deck of cards. This can either be a standard deck, an anonymous deck, or an interleaved deck. The function also accepts an object of class "UpDeck" which contains an updated deck and the last dealt card.

Value

A list containing two elements: dealt_card, a data frame representing the card that was dealt, and updated_deck, a data frame representing the remaining cards in the deck. The list has the class attribute "UpDeck".

Examples

# Using a standard deck
std_deck <- standard_deck()
result <- deal_card(std_deck)
result$dealt_card
result$updated_deck

# Using an "UpDeck" object
result2 <- deal_card(result)
result2$dealt_card
result2$updated_deck


[Package mmcards version 0.1.1 Index]