-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChessbot2k17.c
More file actions
71 lines (59 loc) · 1.29 KB
/
Chessbot2k17.c
File metadata and controls
71 lines (59 loc) · 1.29 KB
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
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "AI.h"
int main() {
Intro();
system("clear");
int i = 0;
Piece pieces[64];
while(1) {
PrintMenu();
FILE *fp;
fp = fopen("log.txt", "w+");
if(!fp)
{
printf("Error! Cannot open log.txt\n");
exit(1);
}
/* fclose(fp);*/
int s;
scanf("%d", &s);
if(s == 1) {
Piece *board = MakeBoard(pieces);
for(i = 16; i < 48; i++)
WipePiece(board, i);
Play(board, 0, 0);
}
else if(s == 2) {
Piece *board = MakeBoard(pieces);
for(i = 16; i < 48; i++)
WipePiece(board, i);
Play(board, 0, 1);
}
else if(s == 3) {
Piece *board = MakeBoard(pieces);
for(i = 16; i < 48; i++)
WipePiece(board, i);
Play(board, 1, 0);
}
else if(s == 4) {
Piece *board = MakeBoard(pieces);
for(i = 16; i < 48; i++)
WipePiece(board, i);
Play(board, 1, 1);
}
else if(s == 5)
Help();
else if(s == 6)
Credits();
else if(s == 7) {
printf("Quitting\n");
fclose(fp);
return 0;
}
else
printf("Invalid input, enter a number 1-6!\n");
}
return 0;
}