This is the code that I have so far what is working for now is the selection of who plays first, then asks me to select each box with the corresponding coordinates and to make that step confuses me a bit
Attachment code
#include <stdio.h>
#include <string.h>
void Intro_Primera (char c[4][4]);
void tablero (char c[4][4]);
void sorteo (int a, char c[4][4]);
void partida (char c[4][4],int juego);
int main ()
{
int a;
char c [4][4];
char d [3][3];
printf ("......Bienvenido al Juego TA-TE-TI......\n\n");
Intro_Primera (c);
tablero (c);
sorteo (a,c);
}
void Intro_Primera (char c [4][4])
{
int i,j;
char a={'.'};
for (i=0;i<4;i++)
{
for (j=0;j<4;j++)
{
if (i==0)
{
if (j==0)
c[i][j]=(' ');
else if (j==1)
c[i][j]=('A');
else if (j==2)
c[i][j]=('B');
else if (j==3)
c[i][j]=('C');
}
else
c[i][j]= a;
if (i==1 & j==0)
c[i][j]=('1');
else if (i==2 & j==0)
c[i][j]=('2');
else if (i==3 & j==0)
c[i][j]=('3');
}
}
}
void tablero (char c[4][4])
{
int i,j;
for (i=0; i<4; i++)
{
for (j=0; j<4; j++)
{
if (j<3)
{
printf (" %c |",c[i][j]);
}
else
{
printf (" %c ",c[i][j]);
}
}
if (i<3)
{
printf ("\n--------------\n");
}
}
printf ("\n\n");
}
void sorteo (int a,char c[4][4])
{
int juego=0;
srand (time(NULL));
int n=rand()% 2;
if (n==0)
{
printf ("Usted comienza el Juego\n\nUsted empieza jugando con la X\n");
juego=0;
partida(c,juego);
}
else
{
printf ("La Computadora comienza el Juego\n\nUsted empieza jugando con la O\n");
juego=1;
}
}
void partida (char c[4][4],int juego)
{
char a;
int i,j;
if (juego==0)
{
for (i=0; i<9;i++)
{
printf ("Ingrese las Coordenadas\n");
scanf("%c",&a);
if(a=='1A')
c[1][1]='X';
else if (a=='2A')
c[2][1]='X';
else if (a=='3A')
c[3][1]='X';
else if (a=='1B')
c[1][2]='X';
else if (a=='2B')
c[2][2]='X';
else if (a=='3B')
c[3][2]='X';
else if (a=='1C')
c[1][3]='X';
else if (a=='2C')
c[2][3]='X';
else if (a=='3C')
c[3][3]='X';
tablero (c);
}
}
}