Blackjack: removed more redundant code

This commit is contained in:
Logen Kain 2017-01-21 23:15:56 -07:00
parent c281be6ce8
commit 1ab7e6be7b

View File

@ -33,7 +33,6 @@ int main (int argc, char *argv[])
return 0; return 0;
} }
// Add a starting position. I can have a variable that simply means "continue drawing/printing cards from here"
void print_deck(int *deckOfCards){ void print_deck(int *deckOfCards){
int i; int i;
@ -47,15 +46,12 @@ void shuffel (int *array){
int i, rn, a , tmp; int i, rn, a , tmp;
rn = rand(); rn = rand();
printf("%d\n", rn);
for (i=CARD_MAX; i >= CARD_MAX/CARD_MAX ;i--){ for (i=CARD_MAX; i >= CARD_MAX/CARD_MAX ;i--){
if (i != 0){
a = rn % i; a = rn % i;
tmp = array[a]; tmp = array[a];
array[a] = array[i]; array[a] = array[i];
array[i] = tmp; array[i] = tmp;
} }
} }
}