-
Notifications
You must be signed in to change notification settings - Fork 0
/
8QUEEN.C
71 lines (68 loc) · 1.39 KB
/
8QUEEN.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
71
#include<stdio.h>
#include<conio.h>
#define LT 218
#define RT 191
#define CROSS 197
#define HL 196
#define VL 179
#define TT 194
#define BT 193
#define LST 195
#define RST 180
#define LB 192
#define RB 217
#define BS 8
#define SPACE 32
#define WIDTH 7
#define HEIGHT 1
#define DIM 8
#define SAFE 1
#define UNSAFE 0
void drawBox()//home
{
int brow,bcol;
int ctr1,ctr2,ctr3;
clrscr();
bcol= (80-(DIM*WIDTH + DIM + 1))/2;
brow= (25-(DIM*HEIGHT + DIM + 1))/2;
// printf("%d %d ",brow,bcol);
gotoxy(bcol,brow);
printf("%c",LT);
for(ctr2=1 ; ctr2 <= DIM ; ctr2++)
{
for(ctr1= 1; ctr1<=WIDTH ; ctr1++)
printf("%c",HL);
printf("%c",TT);
}
printf("%c%c",BS,RT);
//end of first line
for(ctr3=1 ; ctr3 <= DIM ; ctr3++)
{
gotoxy(bcol,++brow);
for(ctr2=1 ; ctr2 <= DIM+1 ; ctr2++)
{
printf("%c",VL);
for(ctr1= 1; ctr1<=WIDTH ; ctr1++)
printf("%c",SPACE);
}
gotoxy(bcol,++brow);
printf("%c",LST);
for(ctr2=1 ; ctr2 <= DIM ; ctr2++)
{
for(ctr1= 1; ctr1<=WIDTH ; ctr1++)
printf("%c",HL);
printf("%c",CROSS);
}
printf("%c%c",BS,RST);
}//end of body
gotoxy(bcol,brow);
printf("%c",LB);
for(ctr2=1 ; ctr2 <= DIM ; ctr2++)
{
for(ctr1= 1; ctr1<=WIDTH ; ctr1++)
printf("%c",HL);
printf("%c",BT);
}
printf("%c%c",BS,RB);
//end of last line
}