Demineur

Description

Demineur, c'est un jeu en mode MS-Dos avec 3 niveaux de difficulter.
Je me suis inspirer de DEMINEUR windows sauf qu'il a pas de graphique.
Il est supposer avoir aucun bogue, si vous en decouvrer un signaler le moi.

Source / Exemple :


/////////////////////////////////
//    DEMINATOR V2.0     //
//               BY                 //  
//   JEFFREY BÉLANGER   // 
/////////////////////////////////

/*Libraries utiliser pour que le programme fonctionne.*/
#include <iostream>
#include <stdio.h>
#include <stdlib.h>

using namespace std;

void niveau ();
void menu ();
void option ();
void win ();
void game ();
void game_2();
void game_3();
void game_over ();
void tableau ();
void tableau_2 ();
void tableau_3 ();
void score ();

int point = 1000;
int i = 0;
int casse;
int mine_1, mine_2, mine_3, mine_4, mine_5, mine_6, mine_7, mine_8;
int mine_9, mine_10, mine_11, mine_12, mine_13, mine_14, mine_15;
int t1[9] = { 1,2,3,4,5,6,7,8,9 };
int t2[25] = { 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 };
int t3[36] = { 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 }; 

void
menu ()
{
//Fonction menu. 
      int un=1, deux=2, trois=3;
      int choice;
     
     cout << " ___   __  __  \n";
     cout << "| ) ) |-_ |  ) |__| \n\n";
     cout << "°°°°°°°°°°°°°°°°°°°°°°°°° \n";
     cout << "°   °                   ° \n";
     cout << "° "<< un; cout << " °      OPTION       ° \n";
     cout << "° "<< deux; cout << " °      NIVEAU       ° \n";
     cout << "° "<< trois; cout << " °       QUIT        ° \n";
     cout << "°   °                   ° \n";
     cout << "°°°°°°°°°°°°°°°°°°°°°°°°° \n";
     cout << "\nEnter votre choix (0-3): "; //L'utilisateur entre une option MENU.
     cin >> choice;  //Lis le choix de l'utilisatreur.
     
     
          if(choice == un)
            {
              option(); //Envoie l'utilisateur a la fonction OPTION.   
            } 
   

          if(choice == deux)
            {
              niveau(); //Envoie l'utilisateur a la fonction NIVEAU.       
              
            }
          
          if(choice == trois)
            {
              exit(1); //Quitte le programme.
              
            }
             
          exit(1); //Ferme le programme si le choix est pas compris entre 1-3.                                                                                                   
}    
          
void 
option () //Fonction OPTION.
{ 
   
     cout << " __  __ _|_ o __  __                  \n";
     cout << "|__||__) |_,||__||  )                 \n";
     cout << "    |                                  \n\n";
     cout << "   Les reglement sont simple, il a un certain nombre\n";
     cout << "de mine cacher dans la grille, les mines varie selon\n";
     cout << "le niveau choisit. Si tu entre une case et qu'il a une\n";
     cout << "mine cacher tu meurt. Si il n'en a pas tu continue\n\n";
     system("pause"); 
     menu(); //Renvoie l'utilisateur a la fonction MENU.
}

void 
niveau () //Focntion NIVEAU.
{
        int choix;
        int un=1, deux=2, trois=3;          
     cout << " __ o      __  __ \n";
     cout << "|  )| |__/|-_ |--| |__| \n\n";
     cout << "°°°°°°°°°°°°°°°°°°°°°°°°° \n";
     cout << "°   °                   ° \n";
     cout << "° "<< un; cout << " °    EASY  (0-9)    ° \n";
     cout << "° "<< deux; cout << " °   MEDIUM (0-25)   ° \n";
     cout << "° "<< trois; cout << " °    HARD (0-36)    ° \n";
     cout << "°   °                   ° \n";
     cout << "°°°°°°°°°°°°°°°°°°°°°°°°° \n";
     cout << "\nChoisit un niveau (0-3): ";
     cin >> choix; //Lis le CHOIX de l'utilisateur.
     
         
          if(choix == un)
            {  //Ici on mêle les Mine dans la grille. 
              srand (time (NULL));
              mine_1=1+rand()%9;
              mine_2=1+rand()%9;
              mine_3=1+rand()%9;
              mine_4=1+rand()%9;
              cout << "\n";
              game();
              
            }
            
          if(choix == deux)
            {
              srand (time (NULL));
              mine_1=1+rand()%25;
              mine_2=1+rand()%25;
              mine_3=1+rand()%25;
              mine_4=1+rand()%25;
              mine_5=1+rand()%25;
              mine_6=1+rand()%25;
              mine_7=1+rand()%25;
              mine_8=1+rand()%25;
              game_2();
            } 
              
          if(choix == trois)
            {
              srand (time (NULL));
              mine_1=1+rand()%36;
              mine_2=1+rand()%36;
              mine_3=1+rand()%36;
              mine_4=1+rand()%36;
              mine_5=1+rand()%36;
              mine_6=1+rand()%36;
              mine_7=1+rand()%36;
              mine_8=1+rand()%36;
              mine_9=1+rand()%36; 
              mine_10=1+rand()%36; 
              mine_11=1+rand()%36; 
              mine_12=1+rand()%36; 
              mine_13=1+rand()%36; 
              mine_14=1+rand()%36;
              mine_15=1+rand()%36;
              game_3();                    
            }  
      
     exit(1); //EXIT, ferme le programme si le CHOIX est pas compris entre 1 et 3.                
}   

void 
tableau () //Ici on crée la grille de jeu pour le Niveau 1.
{
     //Bloc (1,2,3)
     cout << "°°°°°°°°°°°°°°°°\n";
     cout << "°    °    °    °\n";
     cout << "° 0";
     cout << t1[0];
     cout << " ° 0";
     cout << t1[1];
     cout << " ° 0";
     cout << t1[2];
     cout << " °\n";
     cout << "°    °    °    °\n";
     //Bloc (4,5,6)
     cout << "°°°°°°°°°°°°°°°°\n";
     cout << "°    °    °    °\n";
     cout << "° 0";
     cout << t1[3];
     cout << " ° 0";
     cout << t1[4];
     cout << " ° 0";
     cout << t1[5];
     cout << " °\n";
     cout << "°    °    °    °\n";
     //Bloc (7,8,9)
     cout << "°°°°°°°°°°°°°°°°\n";
     cout << "°    °    °    °\n";
     cout << "° 0";
     cout << t1[06];
     cout << " ° 0";
     cout << t1[7];
     cout << " ° 0";
     cout << t1[8];
     cout << " °\n";
     cout << "°    °    °    °\n";
     cout << "°°°°°°°°°°°°°°°°\n";
}

void 
game () //Fonction Game.
{ //Ici on remplace la valeur par la valeur initial.
          if(t1[0] == 0)
            {
              t1[0] = 1;
            }
            
          if(t1[1] == 0)
            {
              t1[1] = 2;
            }
            
          if(t1[2] == 0)
            {
              t1[2] = 3;
            }
           
          if(t1[3] == 0)
            {
              t1[3] = 4;
            }
            
          if(t1[4] == 0)
            {
              t1[4] = 5;
            }
            
          if(t1[5] == 0)
            {
              t1[5] = 6;
            }
            
          if(t1[6] == 0)
            {
              t1[6] = 7;
            }
            
          if(t1[7] == 0)
            {
              t1[7] = 8;
            }
            
          if(t1[8] == 0)
            {
              t1[8] = 9;
            }
     point = 0;
     i = 0;                                                                                                                                                                                 
     do
     { 
                  
     tableau(); //Envoie l'utilisateur a la fonction Tableau.
     cout << "\nEntrer une case(0-9): ";
     cin >> casse;
         
          if(casse == mine_1)
            {
              game_over();              
            }
            
          if(casse == mine_2)
            {
              game_over();              
            }
            
          if(casse == mine_3)
            {
              game_over();              
            } 
            
          if(casse == mine_4)
            {
              game_over();              
            }                                                                                                                                                                                                                                      
              
          if((casse != mine_1) || (casse != mine_2) || (casse != mine_3) || (casse != mine_4))
            {
              i = i++;
              point = point + 1000;
            }
              
              //Ici on remplace les variable initial des cases par 0.
          if(casse == t1[0])
            {
              t1[0] = 0;
            }
              
          if(casse == t1[1])
            {
              t1[1] = 0; 
            }
             
          if(casse == t1[2])
            {
              t1[2] = 0; 
            }
             
          if(casse == t1[3])
            {
              t1[3] = 0; 
            }
            
          if(casse == t1[4])
            {
               t1[4] = 0; 
            }
              
          if(casse == t1[5])
            {
               t1[5] = 0; 
              }
              
          if(casse == t1[6])
            {
               t1[6] = 0; 
            }
              
          if(casse == t1[7])
            {
               t1[7] = 0; 
            }
              
          if(casse == t1[8])
            {
               t1[8] = 0; 
            }      
              
        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
     while(i != 5);
     win(); //Envoie l'utilisateur a la fonction Win.                
}        

void
tableau_2 ()//Fonction tableau 2.
{  //Ici ont crée la grille de jeu niveau 2.
   //Bloc (1-2-3-4-5)
   cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°\n";
   cout << "°    °    °    °    °    °\n"; 
   cout << "° 0" << t2[0]; cout << " ° 0" << t2[1]; cout << " ° 0" << t2[2];
   cout << " ° 0" << t2[3]; cout << " ° 0" << t2[4]; cout << " °\n"; 
   cout << "°    °    °    °    °    °\n";
   //Bloc (6-7-8-9-10)
   cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°\n";
   cout << "°    °    °    °    °    °\n";
   cout << "° 0" << t2[5]; cout << " ° 0" << t2[6]; cout << " ° 0" << t2[7]; 
   cout << " ° 0" << t2[8]; cout << " ° " << t2[9]; cout << " °\n";
   cout << "°    °    °    °    °    °\n";
   //Bloc (11-12-13-14-15)
   cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°\n";
   cout << "°    °    °    °    °    °\n";
   cout << "° " << t2[10]; cout << " ° " << t2[11]; cout << " ° " << t2[12];
   cout << " ° " << t2[13]; cout << " ° " << t2[14]; cout << " °\n";
   cout << "°    °    °    °    °    °\n";
   //Bloc (16-17-18-19-20)
   cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°\n";
   cout << "°    °    °    °    °    °\n";
   cout << "° " << t2[15]; cout << " ° " << t2[16]; cout << " ° " << t2[17];
   cout << " ° " << t2[18]; cout << " ° " << t2[19]; cout << " °\n";
   cout << "°    °    °    °    °    °\n";
   //Bloc (21-22-23-24-25)
   cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°\n";
   cout << "°    °    °    °    °    °\n";
   cout << "° " << t2[20]; cout << " ° " << t2[21]; cout << " ° " << t2[22];
   cout << " ° " << t2[23]; cout << " ° " << t2[24]; cout << " °\n";
   cout << "°    °    °    °    °    °\n";
   cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°\n";
     
}      

void 
game_2 () //Fonction Game.
{ //Ici on remplace la valeur par la valeur initial.
          if(t2[0] == 0)
            {
              t2[0] = 1;
            }
            
          if(t2[1] == 0)
            {
              t2[1] = 2;
            }
            
          if(t2[2] == 0)
            {
              t2[2] = 3;
            }
           
          if(t2[3] == 0)
            {
              t2[3] = 4;
            }
            
          if(t2[4] == 0)
            {
              t2[4] = 5;
            }
            
          if(t2[5] == 0)
            {
              t2[5] = 6;
            }
            
          if(t2[6] == 0)
            {
              t2[6] = 7;
            }
            
          if(t2[7] == 0)
            {
              t2[7] = 8;
            }
            
          if(t2[8] == 66)
            {
              t2[8] = 9;
            }
            
          if(t2[9] == 66)
            {
              t2[9] = 10;
            }
            
          if(t2[10] == 66)
            {
              t2[10] = 11;
            }
            
          if(t2[11] == 66)
            {
              t2[11] = 12;
            }
           
          if(t2[12] == 66)
            {
              t2[12] = 13;
            }
            
          if(t2[13] == 66)
            {
              t2[13] = 14;
            }
            
          if(t2[14] == 66)
            {
              t2[14] = 15;
            }
            
          if(t2[15] == 66)
            {
              t2[15] = 16;
            }
            
          if(t2[16] == 66)
            {
              t2[16] = 17;
            }
            
          if(t2[17] == 66)
            {
              t2[17] = 18;
            } 
          
          if(t2[18] == 66)
            {
              t2[18] = 19;
            }
            
          if(t2[19] == 66)
            {
              t2[19] = 20;
            }
            
          if(t2[20] == 66)
            {
              t2[20] = 21;
            }
           
          if(t2[21] == 66)
            {
              t2[21] = 22;
            }
            
          if(t2[22] == 66)
            {
              t2[22] = 23;
            }
            
          if(t2[23] == 66)
            {
              t2[23] = 24;
            }
            
          if(t2[24] == 66)
            {
              t2[24] = 25;
            }

     point = 0;
     i = 0;                                                                                                                                                                                 
     do
     { 
                  
     tableau_2(); //Envoie l'utilisateur a la fonction Tableau.
     cout << "\nEntrer une case(0-9): ";
     cin >> casse;
         
          if(casse == mine_1)
            {
              game_over();              
            }
            
          if(casse == mine_2)
            {
              game_over();              
            }
            
          if(casse == mine_3)
            {
              game_over();              
            } 
            
          if(casse == mine_4)
            {
              game_over();              
            }
            
          if(casse == mine_5)
            {
              game_over();              
            }
            
          if(casse == mine_6)
            {
              game_over();              
            }
            
          if(casse == mine_7)
            {
              game_over();              
            } 
            
          if(casse == mine_8)
            {
              game_over();              
            }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
          if((casse != mine_1) || (casse != mine_2) || (casse != mine_3) || (casse != mine_4))
            {
              i = i++;
              point = point + 1000;
            }
  
              //Ici on remplace les variable initial des cases par 0.
          if(casse == t2[0])
            {
              t2[0] = 0;
            }
              
          if(casse == t2[1])
            {
              t2[1] = 0; 
            }
             
          if(casse == t2[2])
            {
              t2[2] = 0; 
            }
             
          if(casse == t2[3])
            {
              t2[3] = 0; 
            }
            
          if(casse == t2[4])
            {
               t2[4] = 0; 
            }
              
          if(casse == t2[5])
            {
               t2[5] = 0; 
              }
              
          if(casse == t2[6])
            {
               t2[6] = 0; 
            }
              
          if(casse == t2[7])
            {
               t2[7] = 0; 
            }
              
          if(casse == t2[8])
            {
               t2[8] = 0; 
            }      
             
          if(casse == t2[9])
            { 
              t2[9] = 66;
            }
              
          if(casse == t2[10])
            {
              t2[10] = 66; 
            }
             
          if(casse == t2[11])
            {
              t2[11] = 66; 
            }
             
          if(casse == t2[12])
            {
              t2[12] = 66; 
            }
            
          if(casse == t2[13])
            {
               t2[13] = 66; 
            }
              
          if(casse == t2[14])
            {
               t2[14] = 66; 
              }
              
          if(casse == t2[15])
            {
               t2[15] = 66; 
            }
              
          if(casse == t2[16])
            {
               t2[16] = 66; 
            }
              
          if(casse == t2[17])
            {
               t2[17] = 66; 
            } 
                 
          if(casse == t2[18])
            {
              t2[18] = 66;
            }
              
          if(casse == t2[19])
            {
              t2[19] = 66; 
            }
             
          if(casse == t2[20])
            {
              t2[20] = 66; 
            }
             
          if(casse == t2[21])
            {
              t2[21] = 66; 
            }
            
          if(casse == t2[22])
            {
               t2[22] = 66; 
            }
              
          if(casse == t2[23])
            {
               t2[23] = 66; 
              }
              
          if(casse == t2[24])
            {
               t2[24] = 66; 
            }    
        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
     while(i != 17);
     win(); //Envoie l'utilisateur a la fonction Win.    
            
}                   

void
tableau_3 ()//Fonction tableau 2.
{  //Ici ont crée la grille de jeu niveau 2.
   //Bloc (1-2-3-4-5-6)
   cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°\n";
   cout << "°    °    °    °    °    °    °\n"; 
   cout << "° 0" << t3[0]; cout << " ° 0" << t3[1]; cout << " ° 0" << t3[2];
   cout << " ° 0" << t3[3]; cout << " ° 0" << t3[4]; cout << " ° 0" << t3[5];
   cout << " °\n"; 
   cout << "°    °    °    °    °    °    °\n";
   //Bloc (7-8-9-10-11-12)
   cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°\n";
   cout << "°    °    °    °    °    °    °\n";
   cout << "° 0" << t3[6]; cout << " ° 0" << t3[7]; cout << " ° 0" << t3[8]; 
   cout << " ° " << t3[9]; cout << " ° " << t3[10]; cout << " ° " << t3[11];
   cout << " °\n";
   cout << "°    °    °    °    °    °    °\n";
   //Bloc (13-14-15-16-17-18)
   cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°\n";
   cout << "°    °    °    °    °    °    °\n";
   cout << "° " << t3[12]; cout << " ° " << t3[13]; cout << " ° " << t3[14];
   cout << " ° " << t3[15]; cout << " ° " << t3[16]; cout << " ° " << t3[17];
   cout << " °\n";
   cout << "°    °    °    °    °    °    °\n";
   //Bloc (19-20-21-22-23-24)
   cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°\n";
   cout << "°    °    °    °    °    °    °\n";
   cout << "° " << t3[18]; cout << " ° " << t3[19]; cout << " ° " << t3[20];
   cout << " ° " << t3[21]; cout << " ° " << t3[22]; cout << " ° " << t3[23];
   cout << " °\n";
   cout << "°    °    °    °    °    °    °\n";
   //Bloc (25-26-27-28-29-30)
   cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°\n";
   cout << "°    °    °    °    °    °    °\n";
   cout << "° " << t3[25]; cout << " ° " << t3[26]; cout << " ° " << t3[27];
   cout << " ° " << t3[28]; cout << " ° " << t3[29]; cout << " ° " << t3[30];
   cout << " °\n";
   cout << "°    °    °    °    °    °    °\n";
   //Bloc (31-32-33-34-35-36)
   cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°\n";
   cout << "°    °    °    °    °    °    °\n";
   cout << "° " << t3[31]; cout << " ° " << t3[32]; cout << " ° " << t3[33];
   cout << " ° " << t3[33]; cout << " ° " << t3[34]; cout << " ° " << t3[35];
   cout << " °\n";
   cout << "°    °    °    °    °    °    °\n";
   cout << "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°\n";     
}      

void 
game_3 () //Fonction Game.
{ //Ici on remplace la valeur par la valeur initial.
          if(t3[0] == 0)
            {
              t3[0] = 1;
            }
            
          if(t3[1] == 0)
            {
              t3[1] = 2;
            }
            
          if(t3[2] == 0)
            {
              t3[2] = 3;
            }
           
          if(t3[3] == 0)
            {
              t3[3] = 4;
            }
            
          if(t3[4] == 0)
            {
              t3[4] = 5;
            }
            
          if(t3[5] == 0)
            {
              t3[5] = 6;
            }
            
          if(t3[6] == 0)
            {
              t3[6] = 7;
            }
            
          if(t3[7] == 0)
            {
              t3[7] = 8;
            }
            
          if(t3[8] == 66)
            {
              t3[8] = 9;
            }
            
          if(t3[9] == 66)
            {
              t3[9] = 10;
            }
            
          if(t3[10] == 66)
            {
              t3[10] = 11;
            }
            
          if(t3[11] == 66)
            {
              t3[11] = 12;
            }
           
          if(t3[12] == 66)
            {
              t3[12] = 13;
            }
            
          if(t3[13] == 66)
            {
              t3[13] = 14;
            }
            
          if(t3[14] == 66)
            {
              t3[14] = 15;
            }
            
          if(t3[15] == 66)
            {
              t2[15] = 16;
            }
            
          if(t3[16] == 66)
            {
              t3[16] = 17;
            }
            
          if(t3[17] == 66)
            {
              t3[17] = 18;
            } 
          
          if(t3[18] == 66)
            {
              t3[18] = 19;
            }
            
          if(t3[19] == 66)
            {
              t3[19] = 20;
            }
            
          if(t3[20] == 66)
            {
              t3[20] = 21;
            }
           
          if(t3[21] == 66)
            {
              t3[21] = 22;
            }
            
          if(t3[22] == 66)
            {
              t3[22] = 23;
            }
            
          if(t3[23] == 66)
            {
              t3[23] = 24;
            }
            
          if(t3[24] == 66)
            {
              t3[24] = 25;
            }

          if(t3[25] == 66)
            {
              t3[25] = 26;
            }
            
          if(t3[26] == 66)
            {
              t3[26] = 27;
            }
            
          if(t3[27] == 66)
            {
              t3[27] = 28;
            }
            
          if(t3[28] == 66)
            {
              t3[28] = 29;
            }
            
          if(t3[29] == 66)
            {
              t3[29] = 30;
            }
            
          if(t3[30] == 66)
            {
              t3[30] = 31;
            }
            
          if(t3[31] == 66)
            {
              t3[31] = 32;
            }
            
          if(t3[32] == 66)
            {
              t3[32] = 33;
            }
            
          if(t3[33] == 66)
            {
              t3[33] = 34;
            } 
          
          if(t3[34] == 66)
            {
              t3[34] = 35;
            }
            
          if(t3[35] == 66)
            {
              t3[35] = 36;
            }
                                                                                                                                   
     point = 0;
     i = 0;                                                                                                                                                                                 
     do
     { 
                  
     tableau_3(); //Envoie l'utilisateur a la fonction Tableau.
     cout << "\nEntrer une case(0-9): ";
     cin >> casse;
         
          if(casse == mine_1)
            {
              game_over();              
            }
            
          if(casse == mine_2)
            {
              game_over();              
            }
            
          if(casse == mine_3)
            {
              game_over();              
            } 
            
          if(casse == mine_4)
            {
              game_over();              
            }
            
          if(casse == mine_5)
            {
              game_over();              
            }
            
          if(casse == mine_6)
            {
              game_over();              
            }
            
          if(casse == mine_7)
            {
              game_over();              
            } 
            
          if(casse == mine_8)
            {
              game_over();              
            }
           
          if(casse == mine_9)
            {
              game_over();              
            }
            
          if(casse == mine_10)
            {
              game_over();              
            }
            
          if(casse == mine_11)
            {
              game_over();              
            } 
            
          if(casse == mine_12)
            {
              game_over();              
            }
            
          if(casse == mine_13)
            {
              game_over();              
            }
            
          if(casse == mine_14)
            {
              game_over();              
            } 
           
          if(casse == mine_15)
            {
              game_over();
            }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
          if((casse != mine_1) || (casse != mine_2) || (casse != mine_3) || (casse != mine_4)
             ||(casse != mine_5) || (casse != mine_6) || (casse != mine_7) || (casse != mine_8)
             ||(casse != mine_9) || (casse != mine_10) || (casse != mine_11) || (casse != mine_12)
             ||(casse != mine_13) || (casse != mine_14) || (casse != mine_15))
            {
              i = i++;
              point = point + 1000;
            }
  
              //Ici on remplace les variable initial des cases par 0 et 66.
          if(casse == t3[0])
            {
              t3[0] = 0;
            }
              
          if(casse == t3[1])
            {
              t3[1] = 0; 
            }
             
          if(casse == t3[2])
            {
              t3[2] = 0; 
            }
             
          if(casse == t3[3])
            {
              t3[3] = 0; 
            }
            
          if(casse == t3[4])
            {
               t3[4] = 0; 
            }
              
          if(casse == t3[5])
            {
               t3[5] = 0; 
              }
              
          if(casse == t3[6])
            {
               t3[6] = 0; 
            }
              
          if(casse == t3[7])
            {
               t3[7] = 0; 
            }
              
          if(casse == t3[8])
            {
               t3[8] = 0; 
            }      
             
          if(casse == t3[9])
            { 
              t3[9] = 66;
            }
              
          if(casse == t3[10])
            {
              t3[10] = 66; 
            }
             
          if(casse == t3[11])
            {
              t3[11] = 66; 
            }
             
          if(casse == t3[12])
            {
              t3[12] = 66; 
            }
            
          if(casse == t2[13])
            {
               t3[13] = 66; 
            }
              
          if(casse == t3[14])
            {
               t3[14] = 66; 
              }
              
          if(casse == t3[15])
            {
               t3[15] = 66; 
            }
              
          if(casse == t3[16])
            {
               t3[16] = 66; 
            }
              
          if(casse == t3[17])
            {
               t3[17] = 66; 
            } 
                 
          if(casse == t3[18])
            {
              t3[18] = 66;
            }
              
          if(casse == t3[19])
            {
              t3[19] = 66; 
            }
             
          if(casse == t3[20])
            {
              t3[20] = 66; 
            }
             
          if(casse == t3[21])
            {
              t3[21] = 66; 
            }
            
          if(casse == t3[22])
            {
               t3[22] = 66; 
            }
              
          if(casse == t3[23])
            {
               t3[23] = 66; 
              }
              
          if(casse == t3[24])
            {
               t3[24] = 66; 
            }
         
          if(casse == t3[25])
            {
              t3[25] = 66;
            }
              
          if(casse == t3[26])
            {
              t3[26] = 66; 
            }
             
          if(casse == t3[27])
            {
              t3[27] = 66; 
            }
             
          if(casse == t3[28])
            {
              t3[28] = 66; 
            }
            
          if(casse == t3[29])
            {
               t3[29] = 66; 
            }
              
          if(casse == t3[30])
            {
               t3[30] = 66; 
              }
              
          if(casse == t3[31])
            {
               t3[31] = 66; 
            }
              
          if(casse == t3[32])
            {
               t3[32] = 66; 
            }
              
          if(casse == t3[33])
            {
               t3[33] = 66; 
            }      
             
          if(casse == t3[34])
            { 
              t3[34] = 66;
            }
              
          if(casse == t3[35])
            {
              t3[35] = 66; 
            }
        }    
                                                                                        
     while(i != 21);
     win(); //Envoie l'utilisateur a la fonction Win.    
            
}                   
       
void
score () //Fonction Score.
{
   cout << " __   \n";
   cout << "|__  __  __  __  __ \n";
   cout << " __||__ |__||  '|-_ \n\n";
   cout << "°°°°°°°°°°°°°°°°°°°°°°°\n";
   cout << "°                     °\n";
   cout << "°  Score : " << point; cout << "       °\n";
   cout << "°                     °\n";
   cout << "°°°°°°°°°°°°°°°°°°°°°°°\n\n";
   system("pause");
   menu();
      
}

 
void 
game_over() //Fonction Game_over.
{
     cout << " ___ \n";
     cout << "| __  __  ___  __   __      __  __ \n";
     cout << "|___||--|| ) )|-_  (__)|__/|-_ |  ' \n\n";
     system("pause");
     score(); //Envoie l"utilisateur a la fonction Score.
}

void
win() //Fonction Win.
{
     cout << "     __              o __  \n";  
     cout << "|__|(__)|__|  |__|__)||  ) \n";
     cout << " __|                       \n\n"; 
     system("pause");
     score(); //Envoie l'utilisateur a la fonction Score.
}                                                     
int 
main() //Fonction Main.
{
  //Titre 
  cout << " __|  __  ___  o  __   __ _|_  __   __     \n";
  cout << "|__| |-_ | ) ) | |  ) |--| |_,|__| |  '    \n";
  cout << "               |__                         \n";
  cout << "               |__) |__|                   \n";
  cout << "                     __|                   \n";
  cout << "       __| o  __ _|_  |_/ o |   |          \n";
  cout << "      (__| | |  ' |_, | | | |__ |__        \n";
  getchar();
  menu(); //Envoie l'utilisateur a la fonction Menu.
  return 0;
}

Conclusion :


La seul mise a jour qu'il va avoir ses en mode graphique.

Codes Sources

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.