include # include # include # include # include # include const int row = 10; const int column = 10; char Board [row][column] ; char Container [row][column] ; char Convert_i(int); int Convert_c (char); void Delay(); void Display(char[][10], int, int); void Initializing_arrays (); void check_inside_board( char [][10], int,int); void check_limits_of_board( char [][10], int, int); void check_corners( char [][10],int, int); void Moveup (char [][10], int, int, char [][10], int, int, int, int); void Movedown(char [][10], int, int, char [][10], int, int, int, int); void Fill_mines(char [][10],int,int,int ); void Checkup (char [][10], int, int ,char [][10],int, int,int,int); void Checkdown (char [][10], int, int,char [][10],int, int,int,int); void Checkright (char [][10], int, int,char [][10],int, int,int,int); void Checkleft (char [][10], int, int,char [][10],int, int,int,int); void Play (); void Demo(); int main() { int counter=0,choice; cout<<" WELCOME TO: "; cout<<" MINESWEEPER "; do { cout<<"Make your choice from the menu below : "; cout<<"1- Demo. "; cout<<"2- Play Minesweeper. "; cout<<"3- Exit the game. "; cin>>choice; switch (choice) { case 1: Demo(); break; case 2: Play(); break; case 3: break; default: cout<<"Wrong choice! You should enter a number between 1 and 3. "; break; } // switch }while (choice!=3); return 0; } // end of main() // Function to convert integer into character char Convert_i (int a) { switch (a) { case 1: return '1'; break; case 2: return '2'; break; case 3: return '3'; break; case 4: return '4'; break; case 5: return '5'; break; case 6: return '6'; break; case 7: return '7'; break; case 8: return '8'; break; default: return '+'; break; } } // Function to convert character into integer int Convert_c (char b) { switch (b) { case 'A': case 'a': return 0; break; case 'B': case 'b': return 1; break; case 'C': case 'c': return 2; break; case 'D': case 'd': return 3; break; case 'E': case 'e': return 4; break; case 'F': case 'f': return 5; break; case 'G': case 'g': return 6; break; case 'H': case 'h': return 7; break; case 'I': case 'i': return 8; break; case 'J': case 'j': return 9; break; default: cout<<"Wrong choice!
To link to this page, copy the following code to your site:
All Papers Are For Research And Reference Purposes Only!
You may not turn these papers in as your own! You must cite our web site as your source!