View source: R/fbc_game_mgmt.R
deal_cards_to_grid | R Documentation |
This function deals n^2 cards from a specified or default deck to form an n x n grid. The remaining deck is also returned alongside the grid.
deal_cards_to_grid(deck = mmcards::shuffle_deck(), n)
deck |
A dataframe representing a deck of cards, with each row being a a card. The parameter is designed to take mmcards::shuffle_deck() or mmcards::i_deck() as input. |
n |
A single integer representing the number of rows and columns in the grid (i.e., the grid will be n x n). This parameter is required and does not have a default value. |
A list containing two elements:
cards_matrix
: an n x n matrix where each element is a list
representing a card.
updated_deck
: a list representing the remaining deck after n^2
cards have been dealt.
# Dealing cards to a 2x2 grid using the default shuffled deck
deal_cards_to_grid(n = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.