I wrote this piece of code to generate a random number between 1 and 6 for a dice game:
int rand() { int n; return n%7==0? (n+1)%7 : n%7; }
Any suggestions to enhance this code?
Aucun commentaire:
Enregistrer un commentaire