Blackjack: removed more redundant code
This commit is contained in:
parent
c281be6ce8
commit
1ab7e6be7b
@ -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;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user