Adding a command that generates a random number between 1-100.
I'm trying to add a command that lets a player automatically say a random number 1-100 in the chat. Any ideas on this one? Also using club source. Thanks, Dante.
//Sin was here
#include <iostream>
#include <ctime> // Needed for the true randomization
#include <cstdlib>
using namespace std;
int main ()
{
int xRan;
srand( time(0)); // This will ensure a really randomized number by help of time.
xRan=rand()%100+1; // Randomizing the number between 1-100.
cout << "Shows a random number between 1-100: " << xRan;
return 0;
}
