1. ///////////////////////////////////////////////////////////
  2. // Titulo : Juego Picas y Fijas //
  3. // Autor : MaztoR //
  4. // Blog : Maztor.blogspot.com || MaztoR [In]-Security //
  5. // Twitter: @Mazt0r //
  6. // Fecha de creacion: [04/Octubre/2012] //
  7. ///////////////////////////////////////////////////////////
  8. #include <cstdlib>
  9. #include <time.h>
  10. #include <iostream>
  11. #include <windows.h>
  12. #include <conio.h>
  13. using namespace std;
  14. int main()
  15. {
  16. //Menu
  17. int opcionx;
  18. //Estados del Ciclo
  19. int status=0;
  20. int status2=0;
  21. // Rango Aleatorios
  22. int r1, r2;
  23. //Numero Generado
  24. int numero;
  25. //Numero Ingresao por el usuario
  26. int num_user;
  27. //Contadores
  28. int contador1, contador2;
  29. //Proceso con vectores aislamiento de cifras
  30. int n, residuo;
  31. //Vectores Numero Aleatorio Generado
  32. int agax, agax1, agax2, agax3, agax4, agax5;
  33. int nivel1[2], nivel2[3], nivel3[5];
  34. //Vectores Numero Aleatorio Ingresado por el usuario
  35. int auserx, auserx1, auserx2, auserx3, auserx4, auserx5;
  36. int iu[2], iu2[3], iu3[5];
  37. //Picas y Fijas
  38. int fijas=0, picas=0;
  39. //Intentos
  40. int intentos=0;
  41. system( "color 70" );
  42. //BANNER DE BIENVENIDA ASCII
  43. Beep ( 659 , 200);
  44. Beep ( 740 , 200);
  45. Sleep (800);
  46. cout<<"\n\t\t .,-:;//;:=,"<<endl;
  47. cout<<"\t\t . :H@@@MM@M#H/.,+%;,"<<endl;
  48. cout<<"\t\t ,/X+ +M@@M@MM%=,-%HMMM@X/,"<<endl;
  49. Beep ( 784 , 200);
  50. cout<<"\t\t -+@MM; $M@@MH+-,;XMMMM@MMMM@+-"<<endl;
  51. cout<<"\t\t ;@M@@M- XM@X;. -+XXXXXHHH@M@M#@/."<<endl;
  52. cout<<"\t\t ,%MM@@MH ,@%= .---=-=:=,."<<endl;
  53. Beep ( 740 , 200);
  54. cout<<"\t\t =@#@@@MX ., -%HX$$%%%+;"<<endl;
  55. cout<<"\t\t =-./@M@M$ PICAS Y FIJAS .;@MMMM@MM:"<<endl;
  56. cout<<"\t\t X@/ -$MM/ .+MM@@@M$"<<endl;
  57. Beep ( 659 , 200);
  58. cout<<"\t\t,@M@H: :@: . =X#@@@@-"<<endl;
  59. cout<<"\t\t,@@@MMX, . /H- ;@M@M="<<endl;
  60. Beep ( 659 , 200);
  61. cout<<"\t\t /MMMM@MMH/. XM@MH; =;"<<endl;
  62. cout<<"\t\t /%+%$XHH@$= MAZTOR , .H@@@@MX,"<<endl;
  63. cout<<"\t\t .=--------. -%H.,@@@@@MX,"<<endl;
  64. Sleep (300);
  65. Beep ( 740 , 200);
  66. cout<<"\t\t .%MM@@@HHHXX$$$%+- .:$MMX =M@@MM%."<<endl;
  67. cout<<"\t\t =XMMM@MM@MM#H;,-+HMM@M+ /MMMX="<<endl;
  68. cout<<"\t\t =%@M@M#@$-.=$@MM@@@M; %M%="<<endl;
  69. Beep ( 587 , 200);
  70. cout<<"\t\t ,:+$+-,/H#MMMMMMM@= =,"<<endl;
  71. cout<<"\t\t =++%%%%+/:-."<<endl;
  72. Sleep (300);
  73. Beep ( 659 , 200);
  74. Beep ( 440 , 200);
  75. Sleep (2000);
  76. system("cls");
  77. srand(time(NULL));
  78. //BUCLE PRINCIPAL || SE ROMPE CON EL STATUS
  79. do{
  80. //MENU PRINCIPAL
  81. cout<<"\t\t//////////////////////////////////////////////////"<<endl;
  82. cout<<"\t\t// Picas y Fijas //"<<endl;
  83. cout<<"\t\t--------------------------------------------------"<<endl;
  84. cout<<"\t\t// 1- Comenzar juego //"<<endl;
  85. cout<<"\t\t// 2- Instrucciones //"<<endl;
  86. cout<<"\t\t// 3- Creditos || Salir //"<<endl;
  87. cout<<"\t\t//////////////////////////////////////////////////\n"<<endl;
  88. cout<<"\t\t Seleccionar opcion: ";
  89. cin>>opcionx;
  90. //BUCLE OPCIONES SUBMENUS
  91. switch (opcionx)
  92. {
  93. //OPCIONES [COMENZAR JUEGO]
  94. case 1:
  95. system("cls");
  96. int subop;
  97. cout<<"\t\t//////////////////////////////////////////////////"<<endl;
  98. cout<<"\t\t// Picas y Fijas //"<<endl;
  99. cout<<"\t\t--------------------------------------------------"<<endl;
  100. cout<<"\t\t// 1- Facil [Padawan] //"<<endl;
  101. cout<<"\t\t// 2- Intermedio [Jedi] //"<<endl;
  102. cout<<"\t\t// 3- Dificil [Darth Vader] //"<<endl;
  103. cout<<"\t\t// 4- Volver al Menu //"<<endl;
  104. cout<<"\t\t//////////////////////////////////////////////////\n"<<endl;
  105. cout<<"\t\t Seleccionar opcionx: ";
  106. cin>>subop;
  107. //SUBOPCIONES
  108. switch (subop)
  109. {
  110. //CASE 1 JUEGO [PRIMORDIALIDAD EN EL CODIGO]
  111. //JUEGO // TROZO DE CODIGO DELICADO
  112. case 1:
  113. system("cls");
  114. cout<<"\t\tEres un Novatillo, el maestro yoda te entrenara!!"<<endl;
  115. Sleep (3000);
  116. system("cls");
  117. Beep ( 659 , 200);
  118. cout<<"\t\t//////////////////////////////////////////////////"<<endl;
  119. cout<<"\t\t// Picas y Fijas //"<<endl;
  120. cout<<"\t\t--------------------------------------------------"<<endl;
  121. cout<<"\t\t// La mision es encontrar el Numero de 3 Cifras //"<<endl;
  122. cout<<"\t\t--------------------------------------------------"<<endl;
  123. cout<<"\t\t// Solo tienes 9 Intentos //"<<endl;
  124. cout<<"\t\t// El maestro Yoda te tiene en entrenamiento //"<<endl;
  125. cout<<"\t\t--------------------------------------------------"<<endl;
  126. do{
  127. //Numero aleatorio
  128. status2=0;
  129. n=100; //Divisor
  130. r1 = 100;
  131. r2 = 999 + 1;
  132. numero = r1+rand()%(r2 - r1);
  133. cout<<"\t\t || Numero aleatorio generado > "<<numero<<endl;
  134. //Descomponer numero Dividiendo
  135. for (contador1=0;contador1<=2;contador1++)
  136. {
  137. nivel1[contador1] = numero/n;
  138. residuo = numero%n;
  139. numero = residuo;
  140. n = n/10;
  141. }
  142. agax=nivel1[0];
  143. agax1=nivel1[1];
  144. agax2=nivel1[2];
  145. //Descartando cifras repetidas en el numero generado
  146. for (contador1=0;contador1<=2;contador1++)
  147. {
  148. if(contador1>=1)
  149. {
  150. if(agax==nivel1[contador1])
  151. {
  152. status2=1;
  153. }
  154. }
  155. if(contador1>=2)
  156. {
  157. if(agax1==nivel1[contador1])
  158. {
  159. status2=1;
  160. }
  161. }
  162. }
  163. }while(status2==1);
  164. //Interaccion del Usuario
  165. do{
  166. fijas=0;
  167. picas=0;
  168. n=100;
  169. status2=0;
  170. cout<<"\t\t ||Digite un numero de 3 cifras > ";
  171. cin>>num_user;
  172. //Descomponer numero Dividiendo
  173. for (contador1=0;contador1<3;contador1++)
  174. {
  175. iu[contador1] = num_user/n;
  176. residuo = num_user%n;
  177. num_user = residuo;
  178. n = n/10;
  179. }
  180. auserx=iu[0];
  181. auserx1=iu[1];
  182. auserx2=iu[2];
  183. //Descartando cifras repetidas en el numero generado
  184. for (contador1=0;contador1<=2;contador1++)
  185. {
  186. if(contador1>=1)
  187. {
  188. if(auserx==iu[contador1])
  189. {
  190. status2=1;
  191. }
  192. }
  193. if(contador1>=2)
  194. {
  195. if(auserx1==iu[contador1])
  196. {
  197. status2=1;
  198. }
  199. }
  200. }
  201. if(status2==1)
  202. {
  203. cout<<"\t\t Alerta!! has Tecleado el mismo numero mas de una vez!!"<<endl;
  204. }else{
  205. //Fijas y picas
  206. for (contador1=0;contador1<=2;contador1++)
  207. {
  208. for(contador2=0;contador2<=2;contador2++)
  209. {
  210. if(iu[contador2]==nivel1[contador1])
  211. {
  212. if(contador2==contador1)
  213. {
  214. fijas++;
  215. }else{
  216. picas++;
  217. }
  218. }
  219. }
  220. }
  221. //Resultados sucesivos
  222. intentos++;
  223. cout<<"\t\t-------------------------------------------------"<<endl;
  224. cout<<"\t\t llevas "<<intentos<<" Intentos."<<endl;
  225. cout<<"\t\t Tienes "<<fijas<<" Fijas > y " <<picas<<" Picas. "<<fijas<<endl;
  226. }
  227. if(fijas==3)
  228. {
  229. status2=0;
  230. }else
  231. {
  232. status2=1;
  233. }
  234. if(intentos==9)
  235. {
  236. status2=0;
  237. }
  238. }while(status2!=0);
  239. //Resultados Finales
  240. if(fijas==3){
  241. system("cls");
  242. Sleep(1000);
  243. cout<<" . . ."<<endl;
  244. cout<<" . ------=========--- . ."<<endl;
  245. cout<<" -)----==== ,' ,' . ."<<endl;
  246. cout<<" . `. `.,;___,' ."<<endl;
  247. cout<<" |||||||||||| "<<endl;
  248. cout<<" _,.....------c==]""______ |,,,,,,.....____ _"<<endl;
  249. cout<<" . . ____--------------------------------____-----"<<endl;
  250. cout<<" ,'"",'. `."<<endl;
  251. cout<<" . -)-----==== `. `. LS"<<endl;
  252. cout<<" . ------=========--- . ."<<endl;
  253. cout<<" . ."<<endl;
  254. Beep ( 740 , 200);
  255. Beep ( 740 , 200);
  256. Beep ( 740 , 200);
  257. Beep ( 740 , 200);
  258. Sleep(2000);
  259. system("cls");
  260. cout<<" _____"<<endl;
  261. cout<<" .'/L|__`."<<endl;
  262. cout<<" | =[_]O|` |"<<endl;
  263. cout<<" | +-------:|"<<endl;
  264. cout<<" __:='|____`-:__ Felicitaciones la nave llego a Salvo!!"<<endl;
  265. cout<<" ||[] ||====| []||"<<endl;
  266. cout<<" ||[] | |=| | []|| Eres el honorable merecedor de ser un maestro jedi!!"<<endl;
  267. cout<<" |:||_|=|U| |_||:|"<<endl;
  268. cout<<" |:|||]_=_ =[_||:| "<<endl;
  269. cout<<" | |||] [_][]C|| |"<<endl;
  270. cout<<" ----------------- "<<endl;
  271. cout<<" ||||||||||||||||| "<<endl;
  272. cout<<" |___| ||| |___| "<<endl;
  273. cout<<" `---' |___| `---' "<<endl;
  274. cout<<" `---' "<<endl;
  275. intentos=0;
  276. Beep ( 740 , 200);
  277. cout<<"\n\t\tPresione enter para dirigirse al menu\n"<<endl;
  278. getch();
  279. system("cls");
  280. }
  281. if(intentos==9){
  282. system("cls");
  283. Sleep(1000);
  284. cout<<" . . ."<<endl;
  285. cout<<" . ------=========--- . ."<<endl;
  286. cout<<" -)----==== ,' ,' . ."<<endl;
  287. cout<<" . `. `.,;___,' ."<<endl;
  288. cout<<" |||||||||||| "<<endl;
  289. cout<<" _,.....------c==]""______ |,,,,,,.....____ _"<<endl;
  290. cout<<" . . ____--------------------------------____-----"<<endl;
  291. cout<<" ,'"",'. `."<<endl;
  292. cout<<" . -)-----==== `. `. LS"<<endl;
  293. cout<<" . ------=========--- . ."<<endl;
  294. cout<<" . ."<<endl;
  295. Beep ( 740 , 200);
  296. Beep ( 740 , 200);
  297. Beep ( 740 , 200);
  298. Beep ( 740 , 200);
  299. Sleep(1000);
  300. system("cls");
  301. cout<<"\t\t\t _.-^^---....,,--"<<endl;
  302. cout<<"\t\t\t _-- --_"<<endl;
  303. cout<<"\t\t\t < >)"<<endl;
  304. cout<<"\t\t\t | |"<<endl;
  305. cout<<"\t\t\t ._ _./"<<endl;
  306. cout<<"\t\t\t ```--. . , ; .--'''"<<endl;
  307. cout<<"\t\t\t | | |"<<endl;
  308. cout<<"\t\t\t .-=|| | |=-."<<endl;
  309. cout<<"\t\t\t `-=#$%&%$#=-'"<<endl;
  310. cout<<"\t\t\t | ; :|"<<endl;
  311. cout<<"\t\t\t _____.,-#%&$@%#&#~,._____ "<<endl;
  312. Sleep(1000);
  313. cout<<"\n\tLa nave ha sido Destruida!! No eres apto para ser maestro jedi\n"<<endl;
  314. intentos=0;
  315. Beep ( 740 , 200);
  316. cout<<"\n\t\tPresione enter para dirigirse al menu\n"<<endl;
  317. getch();
  318. system("cls");
  319. }
  320. break;
  321. case 2:
  322. system("cls");
  323. cout<<"\t\tCon que te crees un Maestro Jedi?? Te pondre a prueba!"<<endl;
  324. Sleep (3000);
  325. system("cls");
  326. Beep ( 659 , 200);
  327. cout<<"\t\t//////////////////////////////////////////////////"<<endl;
  328. cout<<"\t\t// Picas y Fijas //"<<endl;
  329. cout<<"\t\t--------------------------------------------------"<<endl;
  330. cout<<"\t\t// La mision es encontrar el Numero de 4 Cifras //"<<endl;
  331. cout<<"\t\t--------------------------------------------------"<<endl;
  332. cout<<"\t\t// Solo tienes 10 Intentos , Nuestro futuro... //"<<endl;
  333. cout<<"\t\t// Esta en tus Manos... Confiamos en TI! //"<<endl;
  334. cout<<"\t\t--------------------------------------------------"<<endl;
  335. do{
  336. status2=0;
  337. n=1000;
  338. r1 = 1000;
  339. r2 = 9999 + 1;
  340. numero = r1+rand()%(r2 - r1);
  341. cout<<"\t\t || Numero aleatorio generado > "<<numero<<endl;
  342. for (contador1=0;contador1<4;contador1++)
  343. {
  344. nivel2[contador1] = numero/n;
  345. residuo = numero%n;
  346. numero = residuo;
  347. n = n/10;
  348. }
  349. agax=nivel2[0];
  350. agax1=nivel2[1];
  351. agax2=nivel2[2];
  352. agax3=nivel2[3];
  353. for (contador1=0;contador1<=3;contador1++)
  354. {
  355. if(contador1>=1)
  356. {
  357. if(agax==nivel2[contador1])
  358. {
  359. status2=1;
  360. }
  361. }
  362. if(contador1>=2)
  363. {
  364. if(agax1==nivel2[contador1])
  365. {
  366. status2=1;
  367. }
  368. }
  369. if(contador1>=3)
  370. {
  371. if(agax2==nivel2[contador1])
  372. {
  373. status2=1;
  374. }
  375. }
  376. }
  377. }while(status2==1);
  378. do{
  379. fijas=0;
  380. picas=0;
  381. n=1000;
  382. status2=0;
  383. cout<<"\t\t ||Digite un numero de 4 cifras > ";
  384. cin>>num_user;
  385. for (contador1=0;contador1<4;contador1++)
  386. {
  387. iu2[contador1] = num_user/n;
  388. residuo = num_user%n;
  389. num_user = residuo;
  390. n = n/10;
  391. }
  392. auserx=iu2[0];
  393. auserx1=iu2[1];
  394. auserx2=iu2[2];
  395. auserx3=iu2[3];
  396. for (contador1=0;contador1<=3;contador1++)
  397. {
  398. if(contador1>=1)
  399. {
  400. if(auserx==iu2[contador1])
  401. {
  402. status2=1;
  403. }
  404. }
  405. if(contador1>=2)
  406. {
  407. if(auserx1==iu2[contador1])
  408. {
  409. status2=1;
  410. }
  411. }
  412. if(contador1>=3)
  413. {
  414. if(auserx2==iu2[contador1])
  415. {
  416. status2=1;
  417. }
  418. }
  419. }
  420. if(status2==1)
  421. {
  422. cout<<"\t\t Alerta!! has Tecleado el mismo numero mas de una vez!!"<<endl;
  423. }else
  424. {
  425. for (contador1=0;contador1<=3;contador1++)
  426. {
  427. for(contador2=0;contador2<=3;contador2++)
  428. {
  429. if(iu2[contador2]==nivel2[contador1])
  430. {
  431. if(contador2==contador1)
  432. {
  433. fijas++;
  434. }else
  435. {
  436. picas++;
  437. }
  438. }
  439. }
  440. }
  441. intentos++;
  442. cout<<"\t\t-------------------------------------------------"<<endl;
  443. cout<<"\t\t llevas "<<intentos<<" Intentos."<<endl;
  444. cout<<"\t\t Tienes "<<fijas<<" Fijas > y " <<picas<<" Picas. "<<fijas<<endl;
  445. }
  446. if(fijas==4)
  447. {
  448. status2=0;
  449. }else
  450. {
  451. status2=1;
  452. }
  453. if(intentos==10)
  454. {
  455. status2=0;
  456. }
  457. }while(status2!=0);
  458. if(fijas==4){
  459. system("cls");
  460. Sleep(1000);
  461. cout<<" . . ."<<endl;
  462. cout<<" . ------=========--- . ."<<endl;
  463. cout<<" -)----==== ,' ,' . ."<<endl;
  464. cout<<" . `. `.,;___,' ."<<endl;
  465. cout<<" |||||||||||| "<<endl;
  466. cout<<" _,.....------c==]""______ |,,,,,,.....____ _"<<endl;
  467. cout<<" . . ____--------------------------------____-----"<<endl;
  468. cout<<" ,'"",'. `."<<endl;
  469. cout<<" . -)-----==== `. `. LS"<<endl;
  470. cout<<" . ------=========--- . ."<<endl;
  471. cout<<" . ."<<endl;
  472. Beep ( 740 , 200);
  473. Beep ( 740 , 200);
  474. Beep ( 740 , 200);
  475. Beep ( 740 , 200);
  476. Sleep(1000);
  477. system("cls");
  478. cout<<" _____"<<endl;
  479. cout<<" .'/L|__`."<<endl;
  480. cout<<" | =[_]O|` |"<<endl;
  481. cout<<" | +-------:|"<<endl;
  482. cout<<" __:='|____`-:__ Felicitaciones la nave llego a Salvo!!"<<endl;
  483. cout<<" ||[] ||====| []||"<<endl;
  484. cout<<" ||[] | |=| | []|| Eres el honorable merecedor de ser un maestro jedi!!"<<endl;
  485. cout<<" |:||_|=|U| |_||:|"<<endl;
  486. cout<<" |:|||]_=_ =[_||:| "<<endl;
  487. cout<<" | |||] [_][]C|| |"<<endl;
  488. cout<<" ----------------- "<<endl;
  489. cout<<" ||||||||||||||||| "<<endl;
  490. cout<<" |___| ||| |___| "<<endl;
  491. cout<<" `---' |___| `---' "<<endl;
  492. cout<<" `---' "<<endl;
  493. intentos=0;
  494. Beep ( 740 , 200);
  495. cout<<"\n\t\tPresione enter para dirigirse al menu\n"<<endl;
  496. getch();
  497. system("cls");
  498. }
  499. if(intentos==10){
  500. system("cls");
  501. Sleep(1000);
  502. cout<<" . . ."<<endl;
  503. cout<<" . ------=========--- . ."<<endl;
  504. cout<<" -)----==== ,' ,' . ."<<endl;
  505. cout<<" . `. `.,;___,' ."<<endl;
  506. cout<<" |||||||||||| "<<endl;
  507. cout<<" _,.....------c==]""______ |,,,,,,.....____ _"<<endl;
  508. cout<<" . . ____--------------------------------____-----"<<endl;
  509. cout<<" ,'"",'. `."<<endl;
  510. cout<<" . -)-----==== `. `. LS"<<endl;
  511. cout<<" . ------=========--- . ."<<endl;
  512. cout<<" . ."<<endl;
  513. Beep ( 740 , 200);
  514. Beep ( 740 , 200);
  515. Beep ( 740 , 200);
  516. Beep ( 740 , 200);
  517. Sleep(1000);
  518. system("cls");
  519. cout<<"\t\t\t _.-^^---....,,--"<<endl;
  520. cout<<"\t\t\t _-- --_"<<endl;
  521. cout<<"\t\t\t < >)"<<endl;
  522. cout<<"\t\t\t | |"<<endl;
  523. cout<<"\t\t\t ._ _./"<<endl;
  524. cout<<"\t\t\t ```--. . , ; .--'''"<<endl;
  525. cout<<"\t\t\t | | |"<<endl;
  526. cout<<"\t\t\t .-=|| | |=-."<<endl;
  527. cout<<"\t\t\t `-=#$%&%$#=-'"<<endl;
  528. cout<<"\t\t\t | ; :|"<<endl;
  529. cout<<"\t\t\t _____.,-#%&$@%#&#~,._____ "<<endl;
  530. Sleep(1000);
  531. cout<<"\n\tLa nave ha sido Destruida!! No eres apto para ser maestro jedi\n"<<endl;
  532. intentos=0;
  533. Beep ( 740 , 200);
  534. cout<<"\n\t\tPresione enter para dirigirse al menu\n"<<endl;
  535. getch();
  536. system("cls");
  537. }
  538. break;
  539. case 3:
  540. system("cls");
  541. cout<<"\t\tSolo las almas oscuras seran capaces att: Darth vader"<<endl;
  542. Sleep (3000);
  543. system("cls");
  544. Beep ( 659 , 200);
  545. cout<<" ________ ___ ____"<<endl;
  546. cout<<" / __ __| | _ | | _ | "<<endl;
  547. cout<<" ______> | | | | _ || /_______________________________"<<endl;
  548. cout<<" / _______/ |_| |_| |_||_||______________________________ __| "<<endl;
  549. cout<<" / / | | "<<endl;
  550. cout<<" | | La capacidad de destruir un planeta | |"<<endl;
  551. cout<<" | | es insignificante, comparada al poder de la fuerza | |"<<endl;
  552. cout<<" | | | |"<<endl;
  553. cout<<" | | Objetivos | |"<<endl;
  554. cout<<" | | * Descifrar la clave de Obi-wan | |"<<endl;
  555. cout<<" | | * hacerlo en 13 Intentos | |"<<endl;
  556. cout<<" | | | |"<<endl;
  557. cout<<" | | Son 6 Digitos y tenemos poco tiempo. | |"<<endl;
  558. cout<<" | | | |"<<endl;
  559. cout<<" |_|__________________________________________________________|_|"<<endl;
  560. cout<<" |___________________________________________________________/"<<endl;
  561. do{
  562. status2=0;
  563. n=100000;
  564. r1 = 100000;
  565. r2 = 999999 + 1;
  566. numero = r1+rand()%(r2 - r1);
  567. cout<<"\t\t || Numero aleatorio generado > "<<numero<<endl;
  568. for (contador1=0;contador1<6;contador1++)
  569. {
  570. nivel3[contador1] = numero/n;
  571. residuo = numero%n;
  572. numero = residuo;
  573. n = n/10;
  574. }
  575. agax=nivel3[0];
  576. agax1=nivel3[1];
  577. agax2=nivel3[2];
  578. agax3=nivel3[3];
  579. agax4=nivel3[4];
  580. agax5=nivel3[5];
  581. for (contador1=0;contador1<=5;contador1++)
  582. {
  583. if(contador1>=1)
  584. {
  585. if(agax==nivel3[contador1])
  586. {
  587. status2=1;
  588. }
  589. }
  590. if(contador1>=2)
  591. {
  592. if(agax1==nivel3[contador1])
  593. {
  594. status2=1;
  595. }
  596. }
  597. if(contador1>=3)
  598. {
  599. if(agax2==nivel3[contador1])
  600. {
  601. status2=1;
  602. }
  603. }
  604. if(contador1>=4)
  605. {
  606. if(agax3==nivel3[contador1])
  607. {
  608. status2=1;
  609. }
  610. }
  611. if(contador1>=5)
  612. {
  613. if(agax4==nivel3[contador1])
  614. {
  615. status2=1;
  616. }
  617. }
  618. }
  619. }while(status2==1);
  620. do{
  621. fijas=0;
  622. picas=0;
  623. n=100000;
  624. status2=0;
  625. cout<<"\t\t ||Digite un numero de 6 cifras > ";
  626. cin>>num_user;
  627. for (contador1=0;contador1<6;contador1++)
  628. {
  629. iu3[contador1] = num_user/n;
  630. residuo = num_user%n;
  631. num_user = residuo;
  632. n = n/10;
  633. }
  634. auserx=iu3[0];
  635. auserx1=iu3[1];
  636. auserx2=iu3[2];
  637. auserx3=iu3[3];
  638. auserx4=iu3[4];
  639. auserx5=iu3[5];
  640. for (contador1=0;contador1<=5;contador1++)
  641. {
  642. if(contador1>=1)
  643. {
  644. if(auserx==iu3[contador1])
  645. {
  646. status2=1;
  647. }
  648. }
  649. if(contador1>=2)
  650. {
  651. if(auserx1==iu3[contador1])
  652. {
  653. status2=1;
  654. }
  655. }
  656. if(contador1>=3)
  657. {
  658. if(auserx2==iu3[contador1])
  659. {
  660. status2=1;
  661. }
  662. }
  663. if(contador1>=4)
  664. {
  665. if(auserx3==iu3[contador1])
  666. {
  667. status2=1;
  668. }
  669. }
  670. if(contador1>=5)
  671. {
  672. if(auserx4==iu3[contador1])
  673. {
  674. status2=1;
  675. }
  676. }
  677. }
  678. if(status2==1)
  679. {
  680. cout<<"\t\t Alerta!! has Tecleado el mismo numero mas de una vez!!"<<endl;
  681. }else{
  682. for (contador1=0;contador1<6;contador1++)
  683. {
  684. for(contador2=0;contador2<6;contador2++)
  685. {
  686. if(iu3[contador2]==nivel3[contador1])
  687. {
  688. if(contador2==contador1)
  689. {
  690. fijas++;
  691. }else
  692. {
  693. picas++;
  694. }
  695. }
  696. }
  697. }
  698. intentos++;
  699. cout<<"\t\t-------------------------------------------------"<<endl;
  700. cout<<"\t\t llevas "<<intentos<<" Intentos."<<endl;
  701. cout<<"\t\t Tienes "<<fijas<<" Fijas > y " <<picas<<" Picas. "<<fijas<<endl;
  702. }
  703. if(fijas==6)
  704. {
  705. status2=0;
  706. }else{
  707. status2=1;
  708. }
  709. if(intentos==13)
  710. {
  711. status2=0;
  712. }
  713. }while(status2!=0);
  714. if(fijas==6)
  715. {
  716. system("cls");
  717. Sleep(1000);
  718. cout<<"\t _________________________________ "<<endl;
  719. cout<<"\t |:::::::::::::;;::::::::::::::::::| "<<endl;
  720. cout<<"\t |:::::::::::'~||~~~``:::::::::::::| "<<endl;
  721. cout<<"\t |::::::::' .': o`:::::::::::| "<<endl;
  722. cout<<"\t |:::::::' oo | |o o ::::::::::| "<<endl;
  723. cout<<"\t |::::::: 8 .'.' 8 o :::::::::| "<<endl;
  724. cout<<"\t |::::::: 8 | | 8 :::::::::| "<<endl;
  725. cout<<"\t |::::::: _._| |_,...8 :::::::::| Ya Perteneces al lado oscuro."<<endl;
  726. cout<<"\t |::::::'~--. .--. `. `::::::::| "<<endl;
  727. cout<<"\t |:::::' =8 ~ o ::::::::| "<<endl;
  728. cout<<"\t |::::' 8._ 88. o::::::::| "<<endl;
  729. cout<<"\t |:::' __. ,.ooo~~. o`::::::| "<<endl;
  730. cout<<"\t |::: . -. 88`78o/: `:::::| Sigue mis instrucciones o "<<endl;
  731. cout<<"\t |::' /. o o :: 88`::::| tendre que destruirte"<<endl;
  732. cout<<"\t |:; o|| 8 8 |d. `8 `:::| "<<endl;
  733. cout<<"\t |:. - ^ ^ -' `-`::| "<<endl;
  734. cout<<"\t |::. .:::| "<<endl;
  735. cout<<"\t |:::::..... ::' ``::| "<<endl;
  736. cout<<"\t |::::::::-'`- 88 `| "<<endl;
  737. cout<<"\t |:::::-'. - :: | "<<endl;
  738. cout<<"\t |:-~. . . : | "<<endl;
  739. cout<<"\t |_________________________________|"<<endl;
  740. cout<<"\n\t\tPresione enter para dirigirse al menu\n"<<endl;
  741. getch();
  742. system("cls");
  743. intentos=0;
  744. }
  745. if(intentos==13)
  746. {
  747. system("cls");
  748. Sleep(1000);
  749. cout<<"\t ____________ __________________ ___________"<<endl;
  750. cout<<"\t | FRACASADOOOOOOOOOOOOOO |"<<endl;
  751. cout<<"\t | -"" Moriras por hacerme perder el tiempo|"<<endl;
  752. cout<<"\t .-| . ) ( |"<<endl;
  753. cout<<"\t j .'_+ :[ ) .^--.. |"<<endl;
  754. cout<<"\t i -"" |l ]. / i|"<<endl;
  755. cout<<"\t ,"".:j ||o _,,+.,.--, d| :::; b"<<endl;
  756. cout<<"\t i :'| ""--p;. (-._"".oP . :" <<endl;
  757. cout<<"\t ; . ( >,%%% f),):8"" :' i" <<endl;
  758. cout<<"\t i :: j ,;%%%:; ; ; i:%%%., i. `."<<endl;
  759. cout<<"\t i `: ( ____ ,-::::::' ::j [:``` [8: )"<<endl;
  760. cout<<"\t < ..``'::::8888oooooo. :(jj(,;,,, [8:: <"<<endl;
  761. cout<<"\t `. ``:. oo.8888888888:;%%%8o.::.+888+o.:`:' |"<<endl;
  762. cout<<"\t `. ` `o`88888888b`%%%%%88< Y888P""'- ;"<<endl;
  763. cout<<"\t --- . Y888888888., 88b..:::: _ : "<<endl;
  764. cout<<"\t | "".... b`8888888:::::.`8888._::-"" |"<<endl;
  765. cout<<"\t | `:::. `:::::O:::::::.`%%'| |"<<endl;
  766. cout<<"\t | `. ""``::::::'' .' |"<<endl;
  767. cout<<"\t | `. < |"<<endl;
  768. cout<<"\t | +: `: -'; |"<<endl;
  769. cout<<"\t | ____ `: : .::/ |"<<endl;
  770. cout<<"\t | `-|-- ;+_ :::. :..;;; LS |"<<endl;
  771. cout<<"\t |______________;;;;,;;;;;;;;,;;____________|"<<endl;
  772. cout<<"\n\t\tPresione enter para dirigirse al menu\n"<<endl;
  773. getch();
  774. system("cls");
  775. intentos=0;
  776. }
  777. break;
  778. case 4: system("cls");
  779. break;
  780. default: system("cls"); Beep( 790, 300 ); cout<<"\t\tNo Intentes nada RARO Te devolvere al menu principal!"; Sleep(3000);
  781. system("cls");
  782. }
  783. break;
  784. //opcionx2 [INSTRUCCIONES]
  785. case 2:
  786. system("cls");
  787. int subop2;
  788. cout<<"\t/////////////////////////////////////////////////////////////"<<endl;
  789. cout<<"\t// INSTRUCCIONES //"<<endl;
  790. cout<<"\t---------------------------------------------------------- //"<<endl;
  791. cout<<"\t---------------------------------------------------------- //"<<endl;
  792. cout<<"\t// El sistema calculara una cadena de numeros de [3,4 o 6] //"<<endl;
  793. cout<<"\t// Cifras, a su vez, los jugadores tratan de adivinar //"<<endl;
  794. cout<<"\t// el nĂºmero de su oponente [Maquina].Si las cifras son //"<<endl;
  795. cout<<"\t// coincidentes en sus posiciones correctas, son *Fijas*, //"<<endl;
  796. cout<<"\t// Si, en diferentes posiciones, son *Picas*. //"<<endl;
  797. cout<<"\t// //"<<endl;
  798. cout<<"\t// Ejemplo: El numero secreto: 4271 //"<<endl;
  799. cout<<"\t// Intento del oponente: 1234 //"<<endl;
  800. cout<<"\t// //"<<endl;
  801. cout<<"\t// Respuesta: (La fija es '2', las picas son '4' y '1'.) //"<<endl;
  802. cout<<"\t---------------------------------------------------------- //"<<endl;
  803. cout<<"\t---------------------------------------------------------- //"<<endl;
  804. cout<<"\t/////////////////////////////////////////////////////////////\n"<<endl;
  805. cout<<"\t Presione la tecla '1' para volver al menu: ";
  806. cin>>subop2;
  807. //SUBopcionxES
  808. switch (subop2)
  809. {
  810. case 1: system("cls"); break;
  811. default: system("cls"); Beep( 790, 300 ); cout<<"\t\tNo Intentes nada RARO Te devolvere al menu principal!"; Sleep(3000);
  812. system("cls");
  813. }
  814. break;
  815. //opcionx3 [CREDITOS - SALIR]
  816. case 3:
  817. system("cls");
  818. Beep( 790, 300 ); Sleep(1000);cout<<"\t/////////////////////////////////////////////////////////////"<<endl;
  819. Beep( 790, 300 ); Sleep(1000);cout<<"\t// Creador //"<<endl;
  820. Beep( 790, 300 ); Sleep(1000);cout<<"\t---------------------------------------------------------- //"<<endl;
  821. Beep( 790, 300 ); Sleep(1000);cout<<"\t---------------------------------------------------------- //"<<endl;
  822. Beep( 790, 300 ); Sleep(1000);cout<<"\t// MaztoR [IN]-Security //"<<endl;
  823. Beep( 790, 300 ); Sleep(1000);cout<<"\t// [Maztor.Blogspot.com] //"<<endl;
  824. Beep( 790, 300 ); Sleep(1000);cout<<"\t//---------------------------------------------------------//"<<endl;
  825. Beep( 790, 300 ); Sleep(1000);cout<<"\t/////////////////////////////////////////////////////////////\n\n"<<endl;
  826. Beep( 800, 800 ); status=1;
  827. break;
  828. default: system("cls"); Beep( 790, 300 ); cout<<"\t\tNo Sabes leer??? No existe esta opcionx -.-!"; Sleep(3000);
  829. system("cls");
  830. }
  831. }while(status==0);
  832. system("PAUSE");
  833. return 0;
  834. }