Professional Documents
Culture Documents
Taimoor Assignment
Taimoor Assignment
Name:
Taimoor Akmal
Submitted to:
Sir Usman Akram
Section:
A
Roll #:
097
Dated: 12-01-2010
#include<iostream.h>
#include<conio.h>
int main()
cout<<"\n\n\t\tMINESWEEPER : ";
char s1[8][8];
int r,c,i;
int x,y,z=0;
cin>>s1[r][c];
cout<<"\n\n";
cout<<" "<<c<<"";
cout<<"\n"<<0;
Dated: 12-01-2010
for(r=0; r<9; r++)
cout<<" "<<s1[r][c];
if(c==8)
cout<<"\n\n";
cout<<r+1;
cout<<"\n\nEnter X = ";
cin>>x;
cout<<"Enter Y = ";
cin>>y;
if(s1[x][y]=='o')
if(s1[x-1][y]=='m')
z++;
if(s1[x+1][y]=='m')
z++;
Dated: 12-01-2010
if(s1[x][y-1]=='m' && y!=0)
z++;
z++;
z++;
z++;
if(s1[x-1][y+1]=='m'&& y+1<9)
z++;
z++;
cout<<"\n\n";
cout<<" "<<c<<"";
cout<<"\n"<<0;
cout<<" "<<z;
Dated: 12-01-2010
else
cout<<" "<<s1[r][c];
if(c==8)
cout<<"\n\n";
cout<<r+1;
if(s1[x][y]=='m')
cout<<s1[x][y];
else
z=0;
getch();
return 0;
Reference:
Taken from Wikipedia.
Dated: 12-01-2010