/////////////////////////////////////////////////////////// // Titulo : Juego Picas y Fijas // // Autor : MaztoR // // Blog : Maztor.blogspot.com || MaztoR [In]-Security // // Twitter: @Mazt0r // // Fecha de creacion: [04/Octubre/2012] // /////////////////////////////////////////////////////////// #include #include #include #include #include using namespace std; int main() { //Menu int opcionx; //Estados del Ciclo int status=0; int status2=0; // Rango Aleatorios int r1, r2; //Numero Generado int numero; //Numero Ingresao por el usuario int num_user; //Contadores int contador1, contador2; //Proceso con vectores aislamiento de cifras int n, residuo; //Vectores Numero Aleatorio Generado int agax, agax1, agax2, agax3, agax4, agax5; int nivel1[2], nivel2[3], nivel3[5]; //Vectores Numero Aleatorio Ingresado por el usuario int auserx, auserx1, auserx2, auserx3, auserx4, auserx5; int iu[2], iu2[3], iu3[5]; //Picas y Fijas int fijas=0, picas=0; //Intentos int intentos=0; system( "color 70" ); //BANNER DE BIENVENIDA ASCII Beep ( 659 , 200); Beep ( 740 , 200); Sleep (800); cout<<"\n\t\t .,-:;//;:=,"<>opcionx; //BUCLE OPCIONES SUBMENUS switch (opcionx) { //OPCIONES [COMENZAR JUEGO] case 1: system("cls"); int subop; cout<<"\t\t//////////////////////////////////////////////////"<>subop; //SUBOPCIONES switch (subop) { //CASE 1 JUEGO [PRIMORDIALIDAD EN EL CODIGO] //JUEGO // TROZO DE CODIGO DELICADO case 1: system("cls"); cout<<"\t\tEres un Novatillo, el maestro yoda te entrenara!!"< "<=1) { if(agax==nivel1[contador1]) { status2=1; } } if(contador1>=2) { if(agax1==nivel1[contador1]) { status2=1; } } } }while(status2==1); //Interaccion del Usuario do{ fijas=0; picas=0; n=100; status2=0; cout<<"\t\t ||Digite un numero de 3 cifras > "; cin>>num_user; //Descomponer numero Dividiendo for (contador1=0;contador1<3;contador1++) { iu[contador1] = num_user/n; residuo = num_user%n; num_user = residuo; n = n/10; } auserx=iu[0]; auserx1=iu[1]; auserx2=iu[2]; //Descartando cifras repetidas en el numero generado for (contador1=0;contador1<=2;contador1++) { if(contador1>=1) { if(auserx==iu[contador1]) { status2=1; } } if(contador1>=2) { if(auserx1==iu[contador1]) { status2=1; } } } if(status2==1) { cout<<"\t\t Alerta!! has Tecleado el mismo numero mas de una vez!!"< y " <)"< "<=1) { if(agax==nivel2[contador1]) { status2=1; } } if(contador1>=2) { if(agax1==nivel2[contador1]) { status2=1; } } if(contador1>=3) { if(agax2==nivel2[contador1]) { status2=1; } } } }while(status2==1); do{ fijas=0; picas=0; n=1000; status2=0; cout<<"\t\t ||Digite un numero de 4 cifras > "; cin>>num_user; for (contador1=0;contador1<4;contador1++) { iu2[contador1] = num_user/n; residuo = num_user%n; num_user = residuo; n = n/10; } auserx=iu2[0]; auserx1=iu2[1]; auserx2=iu2[2]; auserx3=iu2[3]; for (contador1=0;contador1<=3;contador1++) { if(contador1>=1) { if(auserx==iu2[contador1]) { status2=1; } } if(contador1>=2) { if(auserx1==iu2[contador1]) { status2=1; } } if(contador1>=3) { if(auserx2==iu2[contador1]) { status2=1; } } } if(status2==1) { cout<<"\t\t Alerta!! has Tecleado el mismo numero mas de una vez!!"< y " <)"< | | | | _ || /_______________________________"< "<=1) { if(agax==nivel3[contador1]) { status2=1; } } if(contador1>=2) { if(agax1==nivel3[contador1]) { status2=1; } } if(contador1>=3) { if(agax2==nivel3[contador1]) { status2=1; } } if(contador1>=4) { if(agax3==nivel3[contador1]) { status2=1; } } if(contador1>=5) { if(agax4==nivel3[contador1]) { status2=1; } } } }while(status2==1); do{ fijas=0; picas=0; n=100000; status2=0; cout<<"\t\t ||Digite un numero de 6 cifras > "; cin>>num_user; for (contador1=0;contador1<6;contador1++) { iu3[contador1] = num_user/n; residuo = num_user%n; num_user = residuo; n = n/10; } auserx=iu3[0]; auserx1=iu3[1]; auserx2=iu3[2]; auserx3=iu3[3]; auserx4=iu3[4]; auserx5=iu3[5]; for (contador1=0;contador1<=5;contador1++) { if(contador1>=1) { if(auserx==iu3[contador1]) { status2=1; } } if(contador1>=2) { if(auserx1==iu3[contador1]) { status2=1; } } if(contador1>=3) { if(auserx2==iu3[contador1]) { status2=1; } } if(contador1>=4) { if(auserx3==iu3[contador1]) { status2=1; } } if(contador1>=5) { if(auserx4==iu3[contador1]) { status2=1; } } } if(status2==1) { cout<<"\t\t Alerta!! has Tecleado el mismo numero mas de una vez!!"< y " <,%%% f),):8"" :' i" <>subop2; //SUBopcionxES switch (subop2) { case 1: system("cls"); break; default: system("cls"); Beep( 790, 300 ); cout<<"\t\tNo Intentes nada RARO Te devolvere al menu principal!"; Sleep(3000); system("cls"); } break; //opcionx3 [CREDITOS - SALIR] case 3: system("cls"); Beep( 790, 300 ); Sleep(1000);cout<<"\t/////////////////////////////////////////////////////////////"<