I have a simple program that so far creates 5 community cards (all ints). I've managed to set these (and they are global variables, that's on purpose), but every time I run the program, they create the same number. Below is the code.
int communityCards[5];
int playerCards[2];
int opponentCards[2];
int communityValues[5];
int playerValues[2];
int opponentValues[2];
int main(int argc, const char * argv[]) {
for (int i = 0; i < 9; i++) {
if (i < 5) {
communityCards[i] = rand() % 52 - i;
for (int a = 0; communityCards[a]!=0; a++) {
communityCards[i]==communityCards[a]?communityCards[i]++: a = a;
}
}
printf("%i ", communityCards[i]);
}
}