Bonjour,

je voudrais éviter d'avoir des doublons avec ma fonction rand(), en effet dans mon jeu de poker je génère 5 cartes, mais parfois l'obtient la même carte...

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
void tirage1(card *main)
{
	int i=0;
	for(i=0; i<5; i++)
	{
		main[i].color= (rand()%4) + 1;
		main[i].value= (rand()%13)+ 1;
	}
}
Merci pour votre aide