-
Notifications
You must be signed in to change notification settings - Fork 3
/
set_up.c
59 lines (51 loc) · 1.43 KB
/
set_up.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
#include <stdio.h>
#include <sos.h>
char board[50][50];
int Player1, Player2, Computer, players, n;
void init_board()
{
for (int row = 0; row < n; row++)
{
for (int col=0; col<n; col++)
{
board[row][col]=' ';
}
}
Player1 = 0;
Player2 = 0;
Computer = 0;
return;
}
void draw_board()
{
int row, col;
printf("\n");
for (int row=0; row<n; row++)
{
printf(" *");
for (col=0; col<n; col++)
{
printf(" %c *", board[row][col]);
}
printf(" \n");
if (row != n)
{
printf(" ");
for(int ii=0; ii<((n*4)+1); ii++)
{
printf("*");
}
printf(" \n");
}
}
printf("\n");
if(players == 1)
{
printf("Player has %d points, while I have %d points.\n", Player1, Computer);
}
else if (players == 2)
{
printf("Player 1 has %d points, while Player 2 has %d points.\n", Player1, Player2);
}
return;
}