Advertisement
Guest User

Untitled

a guest
Nov 16th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.04 KB | None | 0 0
  1. void botNameGen(char *botName);
  2.  
  3.  
  4.  
  5. const char NameStems[][10] = {
  6.     "Sarge: ", "Jenny: ", "Harold: ", "Michael: ", "Rick: ",
  7.     "Axle: ", "Bob: ", "Janine: ", "Ester: ", "Lacey: ",
  8.     "Lexi: ", "George: ", "Nitro: ", "Amber: ", "Coco: ",
  9.     "Ivy: ", "Lauren: ", "Daniel: ", "Josh: ", "Kane: "
  10. };
  11. void botNameGen(char* botName)
  12. {
  13.     botName[0]=0; //initialize the string to "" (zero length string).
  14.  
  15.     strcat(botName, NameStems[(rand() % 20)]);
  16.  
  17.  
  18. }
  19.  
  20. char botPlayer1Name[21]; //Used to hold our character's name
  21.     srand((long)time(NULL)); //Seed the random number generator...
  22.         botNameGen(botPlayer1Name);
  23.    
  24.                                     cout << sPlayer->pName << ": ";
  25.                                     getline(cin,input);
  26.  
  27. if(botPlayer1Name== "Sarge: ")
  28.                 {
  29.                     bool botCounter = true;
  30.                     do
  31.                     {
  32.                         botPlayer1Name == "Sarge: ";
  33.                     }
  34.                     while (botCounter == true);
  35.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement