Kitab O Sunnat

Saturday, March 13, 2010

Mine TC

#include
#include
#include
int main()
{
int arrey[10][10];
char arrey1[10][10];
int b,a,score=0,s=0;
char c,d;
int seed=35;
char z;
for(b=0;b<10;b++)
{
for(a=0;a<10;a++)
{
arrey[b][a]=1;
}
}
for(d=0;d<10;d++)
{
for(c=0;c<10;c++)
{
arrey1[c][d]='-';
}
}
srand(seed);
for(a=0;a<10;a++)
{
a=1+rand()%9;
for(b=0;b<10;b++)
{
b=1+rand()%9;
arrey[a][b]=0;
}
}
while(1)
{
clrscr();
cout<<"\t\t\t\t\tscore is %d\n";
cout<<"\n\t\t\t 0|1|2|3|4|5|6|7|8|9\n";
for(c=0;c<10;c++)
{
for(d=0;d<10;d++)
{
cout<<"\t\t\t___________________________\n";
cout<<"\t\t\t%d |%c|%c|%c|%c|%c|%c|%c|%c|%c|%c|\n";
s++;
if(c==9)
cout<<"\t\t\t---------------------------\n";
}
}
cout<<"Enter the number of row:\n";
cin>>a;
cout<<"Enter the number of columns:\n";
cin>>b;
if(arrey[a][b]==0)
{
c=a;
d=b;
arrey1[c][d]=1;
score=score+1;
}
else
{
cout<<"\n\t\t**********************\n";
cout<<"\t\t*THERE WAS A MINE SO U LOST*\N";
cout<<"\n\t\t**********************\n";
score=0;
seed++;
for(c=0;c<10;c++)
{
for(d=0;d<10;d++)
arrey1[c][d]='-';
}
cout<<"DO YOU WANT TO CONTINUE PRESS'Y':\n";
cout<<"IF YOU WANT TO QUITE PRESS ANY 'N':\n";
z=getch();
if(z!='y')
break;
}
s=0;
}
getch();
return 0;
}

No comments:

NEOBUX

http://www.neobux.com/?r=taahaijaz