Added Unit Tests

This commit is contained in:
2021-10-01 00:27:36 -07:00
parent 88a75e2ddd
commit 52f622b5c3
10 changed files with 271 additions and 454 deletions

View File

@ -72,4 +72,10 @@ uint8_t cardCountPairs(card_t *in, uint8_t inCount, uint8_t number,
void cardShuffle(card_t *hand, uint8_t length) {
arrayShuffle(sizeof(card_t), hand, length);
}
uint8_t cardWriteDeck(card_t *hand) {
uint8_t i;
for(i = 0; i < CARD_DECK_SIZE; i++) hand[i] = i;
return CARD_DECK_SIZE;
}

View File

@ -194,4 +194,12 @@ uint8_t cardCountPairs(
* @param hand Hand to shuffle.
* @param length Length of the hand to shuffle.
*/
void cardShuffle(card_t *hand, uint8_t length);
void cardShuffle(card_t *hand, uint8_t length);
/**
* Write an entire deck of cards (in order) to a given hand.
*
* @param hand Hand to write the deck to.
* @return The count of cards in the deck.
*/
uint8_t cardWriteDeck(card_t *hand);