Professional Documents
Culture Documents
h>
#include<process.h>
#include<conio.h>
#include<stdlib.h>
int j;
void instructions()
{ gotoxy(30,7);
char t;
cout<<”INSTRUCTIONS..”;
cout<<”\n”<<”2 : The theme of this game is to explore the word in the computer’s mind..”;
cout<<”\n”<<5 : After each chance the no.of Accurate and Precise letters in the submitted”;
cout<<”\n”<<” word will be displayed..”;
cout<<”\n”<<6 : Both accurate and precise letters will be present in the computer’s word..”;
cout<<”\n”<<”7 : ACCURATE LETTERS : Those whose position is the same as that in the word..”;
cout<<”\n”<<”8 : PRECISE LETTERS: Those whose position is not the same as that in the word.”;
gotoxy(30,22);
cout<<”!!CLUES!!”;
}
class game
int e,f,g,h;
public:
void minigame();
);
void main()
game z[11];
for(int i=0;i<=10;i++)
{clrscr();
j=0;
char ch;
gotoxy(20,3);
gotoxy(0,7);
instructions();
cin>>ch;
switch(ch)
getch();
}}
void game::minigame()
{ int u,v,w,x;
srand(time(0));
e= (97+rand()%25);
f= (97+rand()%25);
if(e==f)
{for(int i=0;e==f;i++)
{f= (97+rand()%25);}}
g= (97+rand()%25);
if (g==f||g==e)
{for(i=0;g==f||g==e;i++)
{g= (97+rand()%25);}}
h= (97+rand()%25);
if(h==e||h==f||h==g)
{for(i=0;h==e||h==f||h==g;i++)
{h= (97+rand()%25);}}
{cin>>p[k];}
checkp();
cin>> u;
switch(u)
{ case 1: clue1();break;
case 2: clue2();break;
case 3: clue3();break;
case 4: clue4();break;
case 5: clue5();break;
for(k=0;k<4;k++)
{cin>>q[k];}
checkq();
cin>>v;
switch(v)
{ case 1: clue1();break;
case 2: clue2();break;
case 3: clue3();break;
case 4: clue4();break;
case 5: clue5();break;
default: cout<<”\n”<<”Oops!..Sorry you have pressed the wrong key!”;
for(int k=0;k<4;k++)
{cin>>r[k];}
checkr();
cin>> w;
switch(w)
{ case 1: clue1();break;
case 2: clue2();break;
case 3: clue3();break;
case 4: clue4();break;
case 5: clue5();break;
for(int k=0;k<4;k++)
{cin>>s[k];}
checks();
cout<<”\n”<<”\n”<<”The word is “;
for(int y=0;y<4;y++)
{cout<<a[y];}}
void game::checkp()
{ int em=0;
int tr=0;
for(int i=0;i<4;i++)
{ for(int j=o;j<4;j++)
em++;
tr++; }}
if(em==4)
for(i=0;i<4;i++)
{cout<<p[i];}
j=1;}
else
void game::checkq()
{ int em=0;
int tr=0;
for(int i=0;i<4;i++)
{ for(int j=o;j<4;j++)
em++;
if(em==4)
for(i=0;i<4;i++)
{cout<<q[i];}
j=1;}
else
void game::checkr()
{ int em=0;
int tr=0;
for(int i=0;i<4;i++)
{ for(int j=o;j<4;j++)
em++;
tr++; }}
if(em==4)
for(i=0;i<4;i++)
{cout<<r[i];}
j=1;}
else
void game::checks()
{ int em=0;
int tr=0;
for(int i=0;i<4;i++)
{ for(int j=o;j<4;j++)
em++;
tr++; }}
if(em==4)
for(i=0;i<4;i++)
{cout<<s[i];}
j=1;}
else
void game::clue1()
{int u=1+rand()%3;
cout<<”\n”<<a[u];}
void game::clue2()
{ cout<<”a- “<<char(int(a[0])+3);}
void game::clue3()
{ cout<<char(int(a[1])-3)<<”-“<<”char(int(a[1])+3;}
{ cout<<”a- “<<char(int(a[1])+3);}
void game::clue4()
{ cout<<char(int(a[2])-3)<<”-“<<”char(int(a[2])+3;}
{ cout<<”a- “<<char(int(a[2])+3);}
void game::clue5()
{ cout<<char(int(a[3])-3)<<”-“<<”char(int(a[3])+3;}
{ cout<<”a- “<<char(int(a[3])+3);}