I'm attempting to develop a dice game, and I need random numbers to represent the sides of the die.
I can make a number between 1 and 6).
using namespace std;
i = (rand()%6)+1;
cout << i << "\n";
doesn't function very well since when I run the programme a few times, I receive the following output:
So I'd need a command that generates a distinct random number each time, rather than the same one five times in a row.
Is this something that can be done with a command?