Hey im trying to do a connect 4 game in c with multiD arrays
insert
Code:
void drawboard(int board[6][7])
{
int i;
int j;
printf(" 1 2 3 4 5 6 7 \n");
for(i = 5; i >= 0; i = (i - 1))
{
for(j = 0; j < 7; j = (j + 1))
{
printf(" | ");
if(board[i][j] == 1)
{
printf("X");
}
else if(board[i][j] == 2)
{
printf("");
}
else if(board[i][j] == 3)
{
printf("4");
}
else if(board[i][j] == 0);
{
printf(" ");
}
}
printf(" | \n");
}
printf(" ------------------------ \n");
}]
All I really have is this function for drawing the board our teacher provided. Im just trying to find a place to start. Does anyone have advice on how I can fill the board
I want to be able to ask in a loop
printf("What column to place O");
"place that O in a column that will keep track of what has been put there"
and so on until I can check for wins