Restored some of the rendering

This commit is contained in:
2021-05-22 14:18:23 -07:00
parent 2d6d8680bd
commit bba6a4b4a1
36 changed files with 813 additions and 331 deletions

View File

@@ -1,34 +0,0 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "card.h"
void cardDeckFill(card_t *deck) {
uint8_t i;
for(i = 0; i < CARD_DECK_SIZE; i++) {
deck[i] = i;
}
}
void cardShuffle(card_t *hand, uint8_t cardCount) {
uint8_t i, j;
card_t temporary;
for(i = 0; i < cardCount - 1; i++) {
// Select random element from remaining elements.
j = u8randRange(i, cardCount);
temporary = hand[j];// Take out other card
hand[j] = hand[i];// Move my card there
hand[i] = temporary;// Put other card here.
}
}
void cardDeal(card_t *deck, card_t *hand, uint8_t deckSize, uint8_t handSize) {
card_t card;
card = deck[deckSize-1];
deck[deckSize-1] = 0x00;
hand[handSize] = card;
}