-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathproyecto.cpp
785 lines (738 loc) · 24.8 KB
/
proyecto.cpp
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <conio.h>
#include "tablero.h"
void llenar_tablero(void); //Funcion del primer requisito
int validar_casilla(int, int); //Funcion del segundo requisito
bool validar_movimiento(int, int, int, int); //Funcion del tercer requisito
void mover_pieza(int, int, int, int); //Funcion del cuarto requisito
int turno(void); //Funcion del quinto requisito
void pintar_tablero(void); //Funcion del sexto requisito
void imprimir_comidas(void); //Funcion del septimo requisito
char *fichas_comidas[2][16] = {{"0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"}, //Negras
{"0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"}}; //Blancas
char *elemento_tablero[8][8] = {{"-4","-2","-3","-5","-6","-3","-2","-4"},
/*Tablero de juego*/ {"-1","-1","-1","-1","-1","-1","-1","-1"},
{ "0", "0", "0", "0", "0", "0", "0", "0"},
{ "0", "0", "0", "0", "0", "0", "0", "0"},
{ "0", "0", "0", "0", "0", "0", "0", "0"},
{ "0", "0", "0", "0", "0", "0", "0", "0"},
{ "1", "1", "1", "1", "1", "1", "1", "1"},
{ "4", "2", "3", "5", "6", "3", "2", "4"}};
int posicion_tablero[64][2] = {{160, 36},{201, 36},{242, 36},{283, 36},{324, 36},{365, 36},{406, 36},{447, 36},
/*Posiciones del tablero*/ {160, 77},{201, 77},{242, 77},{283, 77},{324, 77},{365, 77},{406, 77},{447, 77},
{160,118},{201,118},{242,118},{283,118},{324,118},{365,118},{406,118},{447,118},
{160,159},{201,159},{242,159},{283,159},{324,159},{365,159},{406,159},{447,159},
{160,200},{201,200},{242,200},{283,200},{324,200},{365,200},{406,200},{447,200},
{160,241},{201,241},{242,241},{283,241},{324,241},{365,241},{406,241},{447,241},
{160,282},{201,282},{242,282},{283,282},{324,282},{365,282},{406,282},{447,282},
{160,323},{201,323},{242,323},{283,323},{324,323},{365,323},{406,323},{447,323}};
int Rturno = 1;
int i_negras = 0;
int i_blancas = 0;
void main(){
char eleccion, movi_x, movi_y;
int x_i, y_i, x_f, y_f;
bool flag = true;
bool jugar = true;
char *temp[8][8] = {{"-4","-2","-3","-5","-6","-3","-2","-4"},
{"-1","-1","-1","-1","-1","-1","-1","-1"},
{ "0", "0", "0", "0", "0", "0", "0", "0"},
{ "0", "0", "0", "0", "0", "0", "0", "0"},
{ "0", "0", "0", "0", "0", "0", "0", "0"},
{ "0", "0", "0", "0", "0", "0", "0", "0"},
{ "1", "1", "1", "1", "1", "1", "1", "1"},
{ "4", "2", "3", "5", "6", "3", "2", "4"}};
pintar_tablero();
llenar_tablero();
do{
gotoxy(12,25);
printf("Presione el numero de su eleccion:\n");
printf("\t1. Realizar Jugada.\n");
printf("\t2. Imprimir lista de fichas comidas.\n");
printf("\t3. Reiniciar tablero.\n");
printf("\t4. Salir.\n");
eleccion = getch();
switch(eleccion){
case '1':
jugar = true;
setfillstyle(0,0);
bar(0,350,getmaxx(),getmaxy());
gotoxy(9,25);
printf("Casilla de la Pieza a mover:");
do{
movi_x=getch();
}while(movi_x!='1' && movi_x!='2' && movi_x!='3' && movi_x!='4' && movi_x!='5'&& movi_x!='6' && movi_x!='7' && movi_x!='8');
printf("%c,",movi_x);
do{
movi_y=getch();
}while(movi_y!='1' && movi_y!='2' && movi_y!='3' && movi_y!='4' && movi_y!='5'&& movi_y!='6' && movi_y!='7' && movi_y!='8');
printf("%c\n",movi_y);
x_i = movi_x - 48;
y_i = movi_y - 48;
gotoxy(20,28);
printf("\tCasilla a mover la Pieza:");
do{
movi_x=getch();
}while(movi_x!='1' && movi_x!='2' && movi_x!='3' && movi_x!='4' && movi_x!='5'&& movi_x!='6' && movi_x!='7' && movi_x!='8');
printf("%c,",movi_x);
do{
movi_y=getch();
}while(movi_y!='1' && movi_y!='2' && movi_y!='3' && movi_y!='4' && movi_y!='5'&& movi_y!='6' && movi_y!='7' && movi_y!='8');
printf("%c\n",movi_y);
x_f=movi_x-48;
y_f=movi_y-48;
if(turno() == 1){ //Juegan las blancas
if(validar_movimiento(x_i, y_i, x_f, y_f)){
mover_pieza(x_i, y_i, x_f, y_f);
Rturno = -1;
printf("\tAhora, Juegan las Negras\n");
getch();
setfillstyle(0,0);
bar(0,350,getmaxx(),getmaxy());
break;
}
else{
printf("\tNo se puede hacer el movimiento.\n");
Rturno = 1;
printf("\tContinuan Jugando las Blancas\n");
getch();
setfillstyle(0,0);
bar(0,350,getmaxx(),getmaxy());
break;
}
}
if(turno() == -1){ //Juegan las negras
if(validar_movimiento(x_i,y_i,x_f,y_f)){
mover_pieza(x_i, y_i, x_f, y_f);
Rturno = 1;
printf("\tAhora, Juegan las Blancas\n");
getch();
setfillstyle(0,0);
bar(0,350,getmaxx(),getmaxy());
break;
}
else{
printf("\tNo se puede hacer el movimiento.\n");
Rturno = -1;
printf("\tContinuan Jugando las Negras\n");
getch();
setfillstyle(0,0);
bar(0,350,getmaxx(),getmaxy());
break;
}
}
break;
case '2':
imprimir_comidas();
break;
case '3':
for(x_i=0; x_i<16; x_i++){
fichas_comidas[0][x_i] = "0";
fichas_comidas[1][x_i] = "0";
}
for(x_i=0; x_i<8; x_i++){
for(x_f=0; x_f<8; x_f++){
elemento_tablero[x_i][x_f] = temp[x_i][x_f];
}
}
Rturno = 1;
i_negras = 0;
i_blancas = 0;
pintar_tablero();
llenar_tablero();
break;
case '4':
gotoxy(12,25);
setfillstyle(0,0);
bar(0,0,800,600);
printf("Gracias por jugar...\n\t\tPresione una tecla para continuar.");
flag = false;
getch();
break;
default:
printf("Esa no es una opcion valida, escoja una opcion valida");
break;
}
} while(flag);
closegraph();
}
/*--------------------------------------------------------------------------------------------*/
void llenar_tablero(void){
int k = 0;
settextstyle(0,0,2);
for(int i = 0; i < 8; i++){
for(int j = 0; j < 8; j++){
if(strcmp(elemento_tablero[i][j], "0") != 0){
outtextxy(posicion_tablero[k][0],posicion_tablero[k][1],elemento_tablero[i][j]);
}
k++;
}
}
}
/*---------------------------------------------------------------------------------------------*/
int validar_casilla(int x, int y){
if(strcmp(elemento_tablero[x][y], "-1") == 0){
return -1;
}
if(strcmp(elemento_tablero[x][y], "-2") == 0){
return -1;
}
if(strcmp(elemento_tablero[x][y], "-3") == 0){
return -1;
}
if(strcmp(elemento_tablero[x][y], "-4") == 0){
return -1;
}
if(strcmp(elemento_tablero[x][y], "-5") == 0){
return -1;
}
if(strcmp(elemento_tablero[x][y], "-6") == 0){
return -1;
}
if(strcmp(elemento_tablero[x][y], "0") == 0){
return 0;
}
if(strcmp(elemento_tablero[x][y], "1") == 0){
return 1;
}
if(strcmp(elemento_tablero[x][y], "2") == 0){
return 1;
}
if(strcmp(elemento_tablero[x][y], "3") == 0){
return 1;
}
if(strcmp(elemento_tablero[x][y], "4") == 0){
return 1;
}
if(strcmp(elemento_tablero[x][y], "5") == 0){
return 1;
}
if(strcmp(elemento_tablero[x][y], "6") == 0){
return 1;
}
}
/*----------------------------------------------------------------------------------------------*/
bool validar_movimiento(int x_i, int y_i, int x_f, int y_f){
int xi, yi, xf, yf;
xi = (x_i - 1);
yi = (y_i - 1);
xf = (x_f - 1);
yf = (y_f - 1);
if(Rturno == 1 && validar_casilla(xi, yi) == 1){ //Si la figura que quiere mover es blanca
if(validar_casilla(xf, yf) == 0 || validar_casilla(xf, yf) == -1){ //O no hay nada o hay una del otro color
switch(atoi(elemento_tablero[xi][yi])){
case 6:
//Rey Blanco: solo puede avanzar una posicion en todas las direcciones
if(xi == xf+1 && yi == yf){
//up
return true;
}
if(xi == xf+1 && yi+1 == yf){
//up-der
return true;
}
if(xi == xf && yi == yf+1){
//der
return true;
}
if(xi == xf+1 && yi == yf+1){
//down-der
return true;
}
if(xi+1 == xf && yi == yf){
//down
return true;
}
if(xi+1 == xf && yi-1 == yf){
//down-izq
return true;
}
if(xi == xf && yi-1 ==yf){
//izq
return true;
}
if(xi-1 == xf && yi-1 == yf){
//up-izq
return true;
}
else{ //Movimiento no valido
return false;
}
case 5:
//Reina Blanca: puede avanzar geometricamente en todos los sentidos varias posiciones
if(xi > xf && yi == yf){
//up
return true;
}
if(xi == xf && yi < yf){
//der
return true;
}
if(xi < xf && yi == yf){
//down
return true;
}
if(xi == xf && yi > yf){
//izq
return true;
}
if((xf-xi)/(yf-yi) == 1 || (xf-xi)/(yf-yi) == -1){
//Diagonales
return true;
}
else{ //Movimiento no valido
return false;
}
case 4:
//Torre Blanca: solo puede avanzar horizontal y vertical varias posiciones
if(xi > xf && yi == yf){
//up
return true;
}
if(xi == xf && yi < yf){
//der
return true;
}
if(xi < xf && yi == yf){
//down
return true;
}
if(xi == xf && yi > yf){
//izq
return true;
}
else{ //Movimiento no valido
return false;
}
case 3:
//Arfil Blanco: solo puede avanzar diagonalmente varias posiciones
if((xf-xi)/(yf-yi) == 1 || (xf-xi)/(yf-yi) == -1){
//Diagonales
return true;
}
else{ //Movimiento no valido
return false;
}
case 2:
//Caballo Blanco: solo puede avanzar en L tres posiciones
if(xi-2 == xf && yi-1 == yf){
//up-izq
return true;
}
if(xi-2 == xf && yi+1 == yf){
//up-der
return true;
}
if(xi-1 == xf && yi+2 == yf){
//der-up
return true;
}
if(xi+1 == xf && yi+2 == yf){
//der-down
return true;
}
if(xi+2 == xf && yi+1 == yf){
//down-der
return true;
}
if(xi+2 == xf && yi-1 == yf){
//down-izq
return true;
}
if(xi+1 == xf && yi-2 == yf){
//izq-down
return true;
}
if(xi-1 == xf && yi-2 == yf){
//izq-up
}
else{ //Movimiento no valido
return false;
}
case 1:
//Peon Blanco: solo puede avazar hacia delante una posicion, (Movimiento especial)
if(xi-1 == xf && yi == yf){
//up
return true;
}
if(xi-1 == xf && yi+1 == yf && validar_casilla(xf,yf) == -1){
//up-der-blanca
return true;
}
if(xi-1 == xf && yi-1 == yf && validar_casilla(xf,yf) == -1){
//up-izq-blanca
return true;
}
if(xi == 6 && xf == 4 && yi == yf){
//Movimiento especial up
return true;
}
else{ //Movimiento no valido
return false;
}
}
}
else{
return false;
}
}
if(Rturno == -1 && validar_casilla(xi, yi) == -1){ //Si la figura que quiere mover es negra
if(validar_casilla(xf, yf) == 0 || validar_casilla(xf, yf) == 1){ //O no hay nada o hay una del otro color
switch(atoi(elemento_tablero[xi][yi])){
case -6:
//Rey Negro: solo puede avanzar una posicion en todas las direcciones
if(xi == xf+1 && yi == yf){
//up
return true;
}
if(xi == xf+1 && yi+1 == yf){
//up-der
return true;
}
if(xi == xf && yi == yf+1){
//der
return true;
}
if(xi == xf+1 && yi == yf+1){
//down-der
return true;
}
if(xi+1 == xf && yi == yf){
//down
return true;
}
if(xi+1 == xf && yi-1 == yf){
//down-izq
return true;
}
if(xi == xf && yi-1 ==yf){
//izq
return true;
}
if(xi-1 == xf && yi-1 == yf){
//up-izq
return true;
}
else{ //Movimiento no valido
return false;
}
case -5:
//Reina Negra: puede avanzar geometricamente en todos los sentidos varias posiciones
if(xi > xf && yi == yf){
//up
return true;
}
if(xi == xf && yi < yf){
//der
return true;
}
if(xi < xf && yi == yf){
//down
return true;
}
if(xi == xf && yi > yf){
//izq
return true;
}
if((xf-xi)/(yf-yi) == 1 || (xf-xi)/(yf-yi) == -1){
//Diagonales
return true;
}
else{ //Movimiento no valido
return false;
}
case -4:
//Torre Negra: solo puede avanzar horizontal y vertical varias posiciones
if(xi > xf && yi == yf){
//up
return true;
}
if(xi == xf && yi < yf){
//der
return true;
}
if(xi < xf && yi == yf){
//down
return true;
}
if(xi == xf && yi > yf){
//izq
return true;
}
else{ //Movimiento no valido
return false;
}
case -3:
//Arfil Negro: solo puede avanzar diagonalmente varias posiciones
if((xf-xi)/(yf-yi) == 1 || (xf-xi)/(yf-yi) == -1){
//Diagonales
return true;
}
else{ //Movimiento no valido
return false;
}
case -2:
//Caballo Negro: solo puede avanzar en L tres posiciones
if(xi-2 == xf && yi-1 == yf){
//up-izq
return true;
}
if(xi-2 == xf && yi+1 == yf){
//up-der
return true;
}
if(xi-1 == xf && yi+2 == yf){
//der-up
return true;
}
if(xi+1 == xf && yi+2 == yf){
//der-down
return true;
}
if(xi+2 == xf && yi+1 == yf){
//down-der
return true;
}
if(xi+2 == xf && yi-1 == yf){
//down-izq
return true;
}
if(xi+1 == xf && yi-2 == yf){
//izq-down
return true;
}
if(xi-1 == xf && yi-2 == yf){
//izq-up
}
else{ //Movimiento no valido
return false;
}
case -1:
//Peon Negro: solo puede avazar hacia delante una posicion, (Movimiento especial)
if(xi+1 == xf && yi == yf){
//down
return true;
}
if(xi+1 == xf && yi+1 == yf && validar_casilla(xf,yf) == 1){
//down-der-blanca
return true;
}
if(xi+1 == xf && yi-1 == yf && validar_casilla(xf,yf) == 1){
//down-izq-blanca
return true;
}
if(xi == 1 && xf == 3 && yi == yf){
//Movimiento especial down
return true;
}
else{ //Movimiento no valido
return false;
}
}
}
else{
return false;
}
}
else{
return false;
}
}
/*------------------------------------------------------------------------------------------------------*/
void mover_pieza(int x_i, int y_i, int x_f, int y_f){
int xi, yi, xf, yf;
xi = (x_i - 1);
yi = (y_i - 1);
xf = (x_f - 1);
yf = (y_f - 1);
if(Rturno == -1 && strcmp(elemento_tablero[xf][yf], "0") != 0){
fichas_comidas[0][i_negras] = elemento_tablero[xf][yf];
i_negras++;
}
if(Rturno == 1 && strcmp(elemento_tablero[xf][yf], "0") != 0){
fichas_comidas[1][i_blancas] = elemento_tablero[xf][yf];
i_blancas++;
}
if(strcmp(elemento_tablero[xi][yi], "-1") == 0){
elemento_tablero[xi][yi] = "0";
elemento_tablero[xf][yf] = "-1";
printf("\tSe ha jugado: Peon Negro\n");
}
if(strcmp(elemento_tablero[xi][yi], "-2") == 0){
elemento_tablero[xi][yi] = "0";
elemento_tablero[xf][yf] = "-2";
printf("\tSe ha jugado: Caballo Negro\n");
}
if(strcmp(elemento_tablero[xi][yi], "-3") == 0){
elemento_tablero[xi][yi] = "0";
elemento_tablero[xf][yf] = "-3";
printf("\tSe ha jugado: Arfil Negro\n");
}
if(strcmp(elemento_tablero[xi][yi], "-4") == 0){
elemento_tablero[xi][yi] = "0";
elemento_tablero[xf][yf] = "-4";
printf("\tSe ha jugado: Torre Negra\n");
}
if(strcmp(elemento_tablero[xi][yi], "-5") == 0){
elemento_tablero[xi][yi] = "0";
elemento_tablero[xf][yf] = "-5";
printf("\tSe ha jugado: Reina Negra\n");
}
if(strcmp(elemento_tablero[xi][yi], "-6") == 0){
elemento_tablero[xi][yi] = "0";
elemento_tablero[xf][yf] = "-6";
printf("\tSe ha jugado: Rey Negro\n");
}
if(strcmp(elemento_tablero[xi][yi], "1") == 0){
elemento_tablero[xi][yi] = "0";
elemento_tablero[xf][yf] = "1";
printf("\tSe ha jugado: Peon Blanco\n");
}
if(strcmp(elemento_tablero[xi][yi], "2") == 0){
elemento_tablero[xi][yi] = "0";
elemento_tablero[xf][yf] = "2";
printf("\tSe ha jugado: Caballo Blanco\n");
}
if(strcmp(elemento_tablero[xi][yi], "3") == 0){
elemento_tablero[xi][yi] = "0";
elemento_tablero[xf][yf] = "3";
printf("\tSe ha jugado: Arfil Blanco\n");
}
if(strcmp(elemento_tablero[xi][yi], "4") == 0){
elemento_tablero[xi][yi] = "0";
elemento_tablero[xf][yf] = "4";
printf("\tSe ha jugado: Torre Blanca\n");
}
if(strcmp(elemento_tablero[xi][yi], "5") == 0){
elemento_tablero[xi][yi] = "0";
elemento_tablero[xf][yf] = "5";
printf("\tSe ha jugado: Reina Blanca\n");
}
if(strcmp(elemento_tablero[xi][yi], "6") == 0){
elemento_tablero[xi][yi] = "0";
elemento_tablero[xf][yf] = "6";
printf("\tSe ha jugado: Rey Blanco\n");
}
getch();
pintar_tablero();
llenar_tablero();
gotoxy(9,25);
}
/*------------------------------------------------------------------------------------------------------*/
int turno(void){ /* 1 las Blancas juegan, -1 juegan las Negras*/
return Rturno;
}
/*------------------------------------------------------------------------------------------------------*/
void pintar_tablero(){
int aux;
int x,y;
gra(); //Funcion para cargar los graficos desde la libreria
tablero(); //Funcion para pintar el tablero desde la libreria
/*Diagonal 1*/
x=157;
y=308;
for(aux=0;aux<1;aux++){
setfillstyle(6,7);
bar(x,y,x+39,y+39);
x=x+41;
y=y+41;
}
/*Diagonal 3*/
x=157;
y=226;
for(aux=0;aux<3;aux++){
setfillstyle(6,7);
bar(x,y,x+39,y+39);
x=x+41;
y=y+41;
}
/*Diagonal 5*/
x=157;
y=144;
for(aux=0;aux<5;aux++){
setfillstyle(6,7);
bar(x,y,x+39,y+39);
x=x+41;
y=y+41;
}
/*Diagonal 7*/
x=157;
y=62;
for(aux=0;aux<7;aux++){
setfillstyle(6,7);
bar(x,y,x+39,y+39);
x=x+41;
y=y+41;
}
/*Diagonal 9*/
x=198;
y=21;
for(aux=0;aux<7;aux++){
setfillstyle(6,7);
bar(x,y,x+39,y+39);
x=x+41;
y=y+41;
}
/*Diagonal 11*/
x=280;
y=21;
for(aux=0;aux<5;aux++){
setfillstyle(6,7);
bar(x,y,x+39,y+39);
x=x+41;
y=y+41;
}
/*Diagonal 13*/
x=362;
y=21;
for(aux=0;aux<3;aux++){
setfillstyle(6,7);
bar(x,y,x+39,y+39);
x=x+41;
y=y+41;
}
/*Diagonal 15*/
x=444;
y=21;
for(aux=0;aux<1;aux++){
setfillstyle(6,7);
bar(x,y,x+39,y+39);
x=x+41;
y=y+41;
}
}
/*------------------------------------------------------------------------------------------------*/
void imprimir_comidas(void){
setfillstyle(0,0);
bar(0,350,getmaxx(),getmaxy());
gotoxy(9,25);
printf("Jugador en turno: ");
if(turno() == 1){
printf("Juegan las Blancas\n");
}
if(turno() == -1){
printf("Juegan las Negras\n");
}
printf("\tListado De Fichas Comidas:\n");
printf("\tJugador Blanco: ");
for(int i=0; i<16; i++){
if(strcmp(fichas_comidas[1][i], "0") != 0){
printf(fichas_comidas[1][i]);
printf(", ");
}
}
printf("\n\tJugador Negro: ");
for(int i=0; i<16; i++){
if(strcmp(fichas_comidas[0][i], "0") != 0){
printf(fichas_comidas[0][i]);
printf(", ");
}
}
getch();
setfillstyle(0,0);
bar(0,350,getmaxx(),getmaxy());
gotoxy(9,25);
}