1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
char letter[100] = {'A','A','A','A','A','A','A','A','A','B','B','C','C','D','D','D','D','E','E','E','E','E','E','E','E','E','E','E','E','F','F','G','G','G','H','H','I','I','I','I','I','I','I','I','I','J','K','L','L','L','L','M','M','N','N','N','N','N','N','O','O','O','O','O','O','O','O','P','P','Q','R','R','R','R','R','R','S','S','S','S','T','T','T','T','T','T','U','U','U','U','V','V','W','W','X','Y','Y','Z',' ',' '};
void player_tiles(games players[4], int no, char letter[100], int i){
int j, rd;
printf("Player %d's Tiles: {", i);
for(j=1;j<=7; j++){
if(players[i].tiles[j] == NULL){
do{
srand(time(NULL));
rd=rand()%99;
}while(letter[rd]==NULL);
players[i].tiles[j] = letter[rd];
letter[rd]==NULL;
}
if(j!=7){
printf("%c, ", players[i].tiles[j]);
}else printf("%c", players[i].tiles[j]);
}
printf("}\n");
}
|