-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconds.c
48 lines (40 loc) · 769 Bytes
/
conds.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
#include <stdio.h>
#include <sos.h>
char board[50][50];
int Player1, Player2, Computer, players, n;
int game_done()
{
int row, col;
for (row=0; row<n; row++)
{
for(col=0; col<n; col++)
{
if (board[row][col] == ' ')
{
return 0;
}
}
}
return 1;
}
int square_valid (int square)
{
int row, col;
if(square>0 && square<((n*n)+1))
{
row = (square-1)/n;
col = (square-1)%n;
if (board[row][col]==' ')
{
return 1;
}
else
{
return 0;
}
}
else
{
return 0;
}
}