Exemplo n.º 1
0
void Minesweeper::Move()
{
	Showboard_Front();

	cout<<"Please enter a row number (0-9)";
	cin>>player1.x;
	if (player1.x>9 || player1.x<0)
	{
		cout<<"Please enter a number between 1 and 10"<<endl;
		system("pause");
		system("cls");
		Move();
	}
	cout<<"Please enter a columm number (0-9)";
	cin>>player1.y;
	if (player1.y>9 || player1.y<0)
	{
		cout<<"Please enter a number between 1 and 10"<<endl;
		system("pause");
		system("cls");
		Move();
	}

if (Front[player1.x][player1.y]=='0' || Front[player1.x][player1.y]=='1' || Front[player1.x][player1.y]=='2' || Front[player1.x][player1.y]=='3' || Front[player1.x][player1.y]=='4' || Front[player1.x][player1.y]=='5' || Front[player1.x][player1.y]=='6' || Front[player1.x][player1.y]=='7' || Front[player1.x][player1.y]=='8')
{
	Front[player1.x][player1.y]=Back[player1.x][player1.y];
}
else
{
	Front[player1.x][player1.y]=Back[player1.x][player1.y];
	player1.nonmines++;
}

system("cls");

if (Back[player1.x][player1.y]=='*' || player1.nonmines>=90)
{
	Outro();
}
else
Move();

}
Exemplo n.º 2
0
void CheckCheat(UBYTE c )
{
    static int cheat_counter=0,current_cheat=-1;
    int i;

    if(current_cheat>=0)
    {
        if(cheats[current_cheat][cheat_counter]==c)
        {
            cheat_counter++;

            if(cheat_counter==strlen(cheats[current_cheat]))
            {
                if(!menusound[0])
                    menusound[0]=LoadSound(menu_soundname[0]);

                if(menusound[0])
                    PlayBackSound(menusound[0]);

                D(bug("Eseguo il cheat: %ld\n"/*-*/,current_cheat));

                switch(current_cheat)
                {
                    case 0:
// Gioco l'arcade con l'hurricane force!
                        if(current_menu==MENU_ARCADE_SELECTION)
                        {
                            *teamarray=ARCADE_TEAMS;
                            controllo[ARCADE_TEAMS]=1;
                            turno=0;
                            competition=MENU_CHALLENGE;
                            cb[0].ID=MENU_CHALLENGE;
                            SetupMatches();
                            ChangeMenu(MENU_CHALLENGE);
                        }
                        break;
// Mostra sempre la sequenza finale
                    case 1:
                        final=TRUE;
                        break;
                    case 2:
                        framerate=35;
                        break;
                    case 3:
                        framerate=15;
                        break;
                    case 4:
                        nopari=TRUE;
                        break;
                    case 5:
                        killer=TRUE;
                        break;
                    case 6:
                        warp=TRUE;
                        break;
#ifdef CD_VERSION
                    case 7:
                        Outro();
                        break;
#endif
                }
            }

            return;
        }
        else
        {
Exemplo n.º 3
0
void Concentrate::PlayeronePlay()
{
	player1.guess[0]=0;
	player1.guess[1]=0;

	cout<<"Player One -- Score: "<<player1.matches<<endl;
	Showboard_Front();

	cout<<"Enter guess one ";
	cin>>player1.guess[0];
	cout<<"Enter guess two ";
	cin>>player1.guess[1];



	if (player1.guess[1]==player1.guess[0])
	{
		cout<<"Please choose different spaces"<<endl;
		system("pause");
		system("cls");
		PlayeronePlay();
	}
	else
	{

	for (int x=0;x<2;x++)
	{
		if (player1.guess[x]==1)
			Third[0][0]=Back[0][0];
		else if (player1.guess[x]==2)
			Third[0][1]=Back[0][1];
		else if (player1.guess[x]==3)
			Third[0][2]=Back[0][2];
		else if (player1.guess[x]==4)
			Third[0][3]=Back[0][3];
		else if (player1.guess[x]==5)
			Third[0][4]=Back[0][4];
		else if (player1.guess[x]==6)
			Third[1][0]=Back[1][0];
		else if (player1.guess[x]==7)
			Third[1][1]=Back[1][1];
		else if (player1.guess[x]==8)
			Third[1][2]=Back[1][2];
		else if (player1.guess[x]==9)
			Third[1][3]=Back[1][3];
		else if (player1.guess[x]==10)
			Third[1][4]=Back[1][4];
		else if (player1.guess[x]==11)
			Third[2][0]=Back[2][0];
		else if (player1.guess[x]==12)
			Third[2][1]=Back[2][1];
		else if (player1.guess[x]==13)
			Third[2][2]=Back[2][2];
		else if (player1.guess[x]==14)
			Third[2][3]=Back[2][3];
		else if (player1.guess[x]==15)
			Third[2][4]=Back[2][4];
		else if (player1.guess[x]==16)
			Third[3][0]=Back[3][0];
		else if (player1.guess[x]==17)
			Third[3][1]=Back[3][1];
		else if (player1.guess[x]==18)
			Third[3][2]=Back[3][2];
		else if (player1.guess[x]==19)
			Third[3][3]=Back[3][3];
		else if (player1.guess[x]==20)
			Third[3][4]=Back[3][4];
		else if (player1.guess[x]==21)
			Third[4][0]=Back[4][0];
		else if (player1.guess[x]==22)
			Third[4][1]=Back[4][1];
		else if (player1.guess[x]==23)
			Third[4][2]=Back[4][2];
		else if (player1.guess[x]==24)
			Third[4][3]=Back[4][3];
		else if (player1.guess[x]==25)
			Third[4][4]=Back[4][4];
		else if (player1.guess[x]==26)
			Third[5][0]=Back[5][0];
		else if (player1.guess[x]==27)
			Third[5][1]=Back[5][1];
		else if (player1.guess[x]==28)
			Third[5][2]=Back[5][2];
		else if (player1.guess[x]==29)
			Third[5][3]=Back[5][3];
		else if (player1.guess[x]==30)
			Third[5][4]=Back[5][4];
		else
		{
			cout<<"Please choose numbers between 1 and 30"<<endl;
			system("pause");
			system("cls");
			PlayeronePlay();
		}
	}

	system("cls");
	Showboard_Third();
	
	for (int w=0;w<6;w++)
	{
		for (int x=0;x<5;x++)
		{
			for (int y=0;y<6;y++)
			{
				for (int z=0;z<5;z++)
				{
					if (Third[w][x]==Third[y][z] && Third[w][x]!='*' && Third[y][z]!='*' && w!=y && x!=z && Third[w][x]!='/')
					{
						cout<<"You have a match"<<endl;
						Third[w][x]='/';
						Third[y][z]='/';
						Back[w][x]='/';
						Back[y][z]='/';
						Front[w][x]=0;
						Front[y][z]=0;
						player1.matches++;
							if (player1.matches>=7  && player1.matches+player2.matches==15)
							{
								Outro();
							}
							else
							{
								system("pause");
								system("cls");
								PlayeronePlay();
							}
					}		
	
					
				}
			}
		}
	}


	}

	system("pause");
	Blankboard_Third();
	system("cls");
	PlayertwoPlay();
}