#include #include void welcome(); void play_game(); //ifstream infile;

#include

#include

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

#include

#include

#include

#include

#include

#include

void welcome();

void play_game();

//ifstream infile;

void High_score();

void instructions();

char names3320 = { { “Sana”, “Job”, “Rob” }, { “Maddy”, “Job”, “Rob” }, { “Ebon”, “Job”, “Rob” } };

int times33 = { { 100, 181, 200 }, { 200, 250, 361 }, { 205, 208, 222 } };

using namespace std;

//////////////////////////////////////////

/////////////////////////////////////////

int main(){

       welcome();

       system(“pause>0”);

       return 0;

}

/////////////////////////////////////////

////////////////////////////////////////

void welcome(){

       int option;

       system(“COLOR 1A”);

       cout > option;

       switch (option){

       case 1:

              system(“cls”);

              play_game();

              break;

       case 2:

              system(“cls”);

              High_score();

              break;

       case 3:

              system(“cls”);

              instructions();

              break;

       case 4:

              system(“cls”);

              cout 0″);

              system(“cls”);

              welcome();

       }

}

////////////////////////////////////

////////////////////////////////////

void play_game(){

       int userrow, usercolumn, usermines;

       cout > userrow;

       cout > usercolumn;

       cout > usermines;

       char winarr100100;   // for winning(array)

       int r, c, count = 1, wincount = 0, flagcheck = 0, score = 0;

       int minecount = 0;

       char endchar;

       char minepositions100100; // array for table with
mines and numbers //temporary array for storing and comparing.

       const int rows = 100;

       const int columns = 100;

       bool check = true;

       cout > ch;

 

              cout > r;

 

              cout > c;

 

              if (winarrrc != ‘M’)

                     wincount++;

              if (minepositionsrc == ‘M’ && ch != ‘f’)    //for mine check

              {

                     system(“COLOR 4”);

                     gridrc = ‘M’;

                     usermines–;

                     for (int i = 0; i0″);

                     system(“cls”);

                     welcome();

 

              }

 

              else if (minepositionsrc != ‘M’ && ch != ‘f’)     //for numbers

              {

                     if (minepositionsrc – 1 == ‘M’)  //1

                           minecount++;

                     if (minepositionsrc + 1 == ‘M’)  //2

                           minecount++;

                     if (minepositionsr – 1c – 1 == ‘M’)  //3

                           minecount++;

                     if (minepositionsr + 1c – 1 == ‘M’)  //4

                           minecount++;

                     if (minepositionsr + 1c + 1 == ‘M’)  //5

                           minecount++;

                     if (minepositionsr – 1c + 1 == ‘M’)  //6

                           minecount++;

                     if (minepositionsr – 1c == ‘M’)  //7

                           minecount++;

                     if (minepositionsr + 1c == ‘M’)  //8

                           minecount++;

 

                     if (minecount == 8)

                     {

                           gridrc = minepositionsrc = ‘8’;

                           score = score + 8;

                     }

                     else if (minecount == 7)

                     {

                           gridrc = minepositionsrc = ‘7’;

                           score = score + 7;

                     }

                     else if (minecount == 6)

                     {

                           gridrc = minepositionsrc = ‘6’;

                           score = score + 6;

                     }

                     else if (minecount == 5)

                     {

                           gridrc = minepositionsrc = ‘5’;

                           score = score + 5;

                     }

                     else if (minecount == 4)

                     {

                           gridrc = minepositionsrc = ‘4’;

                           score = score + 4;

                     }

                     else if (minecount == 3)

                     {

                           gridrc = minepositionsrc = ‘3’;

                           score = score + 3;

                     }

                     else if (minecount == 2)

                     {

                           gridrc = minepositionsrc = ‘2’;

                           score = score + 2;

                     }

                     else if (minecount == 1)

                     {

                           gridrc = minepositionsrc = ‘1’;

                           score = score + 1;

                     }

                     else

                     {

                           gridrc = minepositionsrc = ‘0’;

                           score = score + 0;

                     }

 

                     for (int i = 0; i> endchar;

 

       } while (endchar != ‘n’ && wincountusermines){

              system(“cls”);

              cout 0″);

       system(“cls”);

       welcome();

}

//void High_score()

//{

//cout