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
|
//-----------------------------------------------------EXPERT ENDS-----------------------------------------------------------------------------------------------------------------------------
class menu
{
public:
void Menu(int expertMField[][b],char gameGridE[24][24],int Row, int Column){
int selection;
do{
system("CLS");
cout << "********************************MINESWEEPER*************************************\n\n";
cout << "1. Play Beginner Game\n" << "2. Play Intermediate Game\n" << "3. Play Advanced Game\n" << "4. Show Score Board\n" << "5. Quit Game\n\n\n";
cout << "Please enter your selection: ";
cin >> selection;
cout << endl;
switch (selection)
{
case 1:
cout << "Play Beginner Game\n";
cout << "\n";
system("CLS");
gameBoardE Gboard;
Gboard.shuffleBoard(expertMField);
Gboard.init_gameGrid(gameGridE);
Gboard.draw_gameGrid(gameGridE);
Gboard.drawExpertBoard(expertMField);
MoveE Move1;
Move1.playerE(expertMField,gameGridE,Row,Column);
break;
case 2:
cout << "Play Intermediate Game\n";
cout << "\n";
system("CLS");
break;
case 3:
cout << "Play Advanced Game\n";
cout << "\n";
system("CLS");
break;
case 4:
cout << "Show Score Board\n";
cout << "\n";
break;
case 5:
cout << "Goodbye.\n";
break;
default: cout << selection << "is not a valid menu item.\n";
cout << endl;
}
}while(selection !=0);
}
};
//---- End menu----
int main(){
bool alive = true;
int Row, Column;
char gameGridE[24][24];
int expertMField[][b] = {
{9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},
{9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},
{9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},
{9,9,9,9,9,9,9,9,9,9,9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