RicoHeartless

random.h

Apr 23rd, 2016
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. include <ctime>
  2. #include <iostream>
  3. #include <cstdlib>
  4. using namespace std;
  5.  
  6. int random(int MIN, int MAX){
  7. start:
  8. int randnum(0);
  9. srand(time(NULL));
  10. randnum = MIN + rand() % MAX; if (randnum > MAX){ goto start; }
  11. return randnum;
  12. }
Add Comment
Please, Sign In to add comment