Dev - C++ - Ayuda Programa juego de memoria

 
Vista:
sin imagen de perfil
Val: 1
Ha aumentado su posición en 3 puestos en Dev - C++ (en relación al último mes)
Gráfica de Dev - C++

Ayuda Programa juego de memoria

Publicado por Daniel (1 intervención) el 27/11/2019 18:38:17
Hola, necesito ayuda! estoy haciendo un juego de memorama en DevC++ usando matrices, logre que funcione con apres de numeros aleatorios.
El problema es que ahora no se como hacer que se pueda jugar con las palabras declaradas en lugar de con numeros. ¿Alguien que me pueda ayudar?
me urge :(
Se muestra mi correo por si les resulta mas facil
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<time.h>
 
using namespace std;
int opcion,num,i,j;
char matriz[3][4];
string p0="Lapiz";
string p1="Mesa";
string p2="Silla";
string p3="Escritorio";
string p4="Pluma";
string p5="Borrador";
 
void menuJugar();
void menuInstrucciones();
void seleccionarPalabras();
 
int main(){
 
	do{
 
	cout<<"Memorama"<<endl;
	cout<<"Menu:"<<endl;
	cout<<"1.........Jugar"<<endl;
	cout<<"2.........Seleccionar palabras"<<endl;
	cout<<"3.........Instrucciones"<<endl;
	cout<<"4.........Salir"<<endl;
	cin>>opcion;
	switch (opcion){
		case 1: menuJugar();
		break;
		case 2: seleccionarPalabras();
		break;
		case 3: menuInstrucciones();
		break;
		case 4: return 0;
		break;
		default: "Opcion Invalida";
	}
}while (opcion!=4);
}
bool mostrar_posicion(char matriz[3][4],int x1,int y1,int x2, int y2){
int aux,aux2;
 
	for(int i=0;i<4;i++){
 
		for(int j=0;j<4;j++){
 
			if(i==x1 && j==y1){
				aux=matriz[i][j];
				printf("[ %i ]",matriz[i][j]);
			}else if(i==x2 && j==y2){
				aux2=matriz[i][j];
				printf("[ %i ]",matriz[i][j]);
			}else{
				printf("[ X ]");
			}
		}
 
		printf("\n");
	}
 
	if(aux==aux2){
		printf("Correcto \n");
		return true;
	}else{
		printf("Incorrecto \n");
		return false;
	}
 
}
 
void menuJugar(){
	int x1,y1,x2,y2,puntaje=0;
	int aux,aux2;
	for(int i=0;i<4;i++){
 
		for(int j=0;j<7;j++){
 
			matriz[i][j]=rand()%12;
 
		}
 
	}
 
 
for(int i=0;i<4;i++){
 
		for(int j=0;j<4;j++){
 
			printf("[ X ]",matriz[i][j] );
 
		}
 
		printf("\n");
	}
	printf("Ingrese las coordenas X y Y de la posicion 1 que quiere ver \n");
	scanf("%i",&x1);
	scanf("%i",&y1);
 
	printf("Ingrese las coordenas X y Y de la posicion 2 que quiere ver \n");
	scanf("%i",&x2);
	scanf("%i",&y2);
 
	if(mostrar_posicion(matriz,x1,y1,x2,y2)==true){
		puntaje=puntaje+100;
	}
 
	printf("Tu puntaje es: %i \n",puntaje);
 
	system("pause");
}
 
 
 
 
 
 
 
void seleccionarPalabras(){
 
}
void menuInstrucciones(){
}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder