This repository has been archived by the owner on Feb 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
display.c
70 lines (62 loc) · 1.86 KB
/
display.c
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
////
// display.c
// board
//
// Created by app on 2017/11/21.
// Copyright © 2017年 ning. All rights reserved.
// with some changes Adam Domoslawski.
// All rights reserved
//
#include "display.h"
#include "env.h"
void print_map(char **data, int rows, int columns, int crnt_player){
printf("\n\n");
int i,j;
printf(" ");
for(j=0;j<columns;j++){
if(!(j/10))
clrprintf(YELLOW,BLACK,"%d ",j);
else
clrprintf(YELLOW, BLACK,"%d ",j);
}
printf("\n\n");
for(i=0;i<rows;i++){
if(!(i/10))
clrprintf(YELLOW,BLACK,"%d ", i);
else
clrprintf(YELLOW,BLACK,"%d ", i);
if(!(i % 2))
printf(" ");
for(j=0;j<columns;j++){
int plxr ;
for ( plxr=1; plxr<=6; plxr++)
{
if(plxr==crnt_player)
{
if((data[j][i]!=96+crnt_player)&&(data[j][i]!=84+crnt_player)&&
(data[j][i]!=64+crnt_player)&&(data[j][i]!='2')&&(data[j][i]!='1')&&(data[j][i]!='3'))
{
clrprintf(RED, BLACK,"%c ",data[j][i]);
break;
}
else if ((data[j][i]==96+crnt_player)||(data[j][i]==84+crnt_player)||
(data[j][i]==64+crnt_player))
{
clrprintf(GREEN, BLACK,"%c ",data[j][i]);
break;
}
else
{
printf("%c ",data[j][i]);
break;
}
}
else
{
continue;
}
}
}
printf("\n\n");
}
}