1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
|
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
#include <vector>
using namespace std;
class bunny
{
public:
bunny (char x = ' ',char z='*') {}
bunny ( brdray[10] [10]) {={{z,z,z,z,z,z,z,z,z,z},{z,x,x,x,x,x,x,x,x,z},
{z,x,x,x,x,x,x,x,x,z},
{z,x,x,x,x,x,x,x,x,z},
{z,x,x,x,x,x,x,x,x,z},
{z,x,x,x,x,x,x,x,x,z},
{z,x,x,x,x,x,x,x,x,z},
{z,x,x,x,x,x,x,x,x,z},
{z,x,x,x,x,x,x,x,x,z},
{z,z,z,z,z,z,z,z,z,z} }}
}
bunny (int x=5, int y=5): posx (x), posy (y) {} //declaring posx and posy
int setposx (int x)
{
posx=x;
}
int setposy (int y)
{
posy=y;
}
int getposx ()
{
return posx;
}
int getposy ()
{
return posy;
}
char brdray;
int posx;
int posy;
char bunicon;
string name;
char z;
char x ;
};
int getrand ();
void getboard ();
string namelist ();
//////////////////////////////////////////////////////////////////////////////
int main()
{
srand(time(0));
vector <bunny>bunnies;
}
//////////////////////////////////////////////////////////////////////////////
string namelist ()
{
string namearray [18] = {"bon","fur","fluff","foof"
,"bax","tig","uru","ira","esa",
"afe","ige","ifi","floof","tix","dar","vini","ter", "von"};
string none = namearray [getrand()%18];
string ntwo =namearray [getrand()*4%18];
string nthree=namearray [getrand()*7%18];
string fullname=none+ntwo+nthree;
return fullname;
}
void getboard ()
{
for (int a = 0;a<10;a++)
{
for (int b =0;b<10;b++)
cout << brdray [a][b];
cout<<endl;
}
}
int getrand ()
{
return 1+(rand()%6);
}
int getposx (int x)
{
for (int a = 0;a<10;a++)
{
for (int b =0;b<10;b++)
{
brdray [a] [b];
if (brdray[a] [b]);
}
}
}
|