“I bought this guide a few days ago to prepare for my interview with Oracle. Many of the questions they asked me were from this guide. I found this book absolutely great!”
Implement a TIC-TAC-TOE game assuming Computer as one of the player. Optimize it for fast computer play time and space. Do some analysis on memory and processing requirements .
int checkwin()
{
int i;
for (i=0; i1)?’X':’O'):’ ‘);
}
printf(”|\n”);
}
printf(” +—+—+—+\n”);
printf(”\n”);
}
int checkfull()
{
int i, j;
int v=0;
for (i=0; i> “);
scanf(”%d”, &x);
printf(”Enter y >> “);
scanf(”%d”, &y);
if (t[y][x]) {
printf(”Wrong location!\n”);
continue;
} else {
t[y][x]=2;
drawtable();
}
if (checkfull())
break;
for (x=0; x
#include
#include
#include
int t[3][3];
int checkwin()
{
int i;
for (i=0; i1)?’X':’O'):’ ‘);
}
printf(”|\n”);
}
printf(” +—+—+—+\n”);
printf(”\n”);
}
int checkfull()
{
int i, j;
int v=0;
for (i=0; i> “);
scanf(”%d”, &x);
printf(”Enter y >> “);
scanf(”%d”, &y);
if (t[y][x]) {
printf(”Wrong location!\n”);
continue;
} else {
t[y][x]=2;
drawtable();
}
if (checkfull())
break;
for (x=0; x
Leave an Answer/Comment