Advertisement
Hakuhun

I've just coded one of the CoD AI scripts

May 28th, 2014
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5.  
  6. using namespace std;
  7. class Ember{
  8. private:
  9.     string nev;
  10.     string kerdesek[4] = {"Szeretsz programozni?","Szereted a fagyit?","42?","Jól vagy?"};
  11.     string valaszok[2] = {"Igen!","Nem!"};
  12. public:
  13.     Ember(string nNev){
  14.         this->nev = nNev;
  15.     }
  16.  
  17.     void Kommunikal(Ember *p, int kerdesIndex, int valaszIndex){
  18.     cout << this->nev << " kerdese: " +this->kerdesek[kerdesIndex];
  19.     cout << "\n";
  20.     cout << p->nev << " valasza: " + p->valaszok[valaszIndex];
  21.     }
  22. };
  23. int main()
  24. {
  25.     srand(time(NULL));
  26.     int x = rand()%3+0;
  27.     int y = rand()%1+0;
  28.  
  29.     Ember p1("Bela");
  30.     Ember p2("Sanyi");
  31.  
  32.     p1.Kommunikal(&p2,x,y);
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement