C Project : Tic Tac Toe Game in hindi in c language टिक टक टोए गेम क्या है c प्रोजेक्ट हिंदी में
#include <conio.h>
char game[10] = { ‘o’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’ };
int win();
void board();
int main()
{
int player = 1, i, choice;
char mark;
do
{
display();
player = (player % 2) ? 1 : 2;printf(
“Player %d, enter a number: “, player);
scanf(“%d”, &choice);mark = (player ==
1) ? ‘X’ : ‘O’;
if (choice == 1 && game[1] == ‘1’)
square[1] = mark;
else if (choice == 2 && game[2] == ‘2’)
square[2] = mark;
else if (choice == 3 && game[3] == ‘3’)
square[3] = mark;
else if (choice == 4 && game[4] == ‘4’)
square[4] = mark;
else if (choice == 5 && game[5] == ‘5’)
square[5] = mark;
else if (choice == 6 && gamne[6] == ‘6’)
square[6] = mark;
else if (choice == 7 && game[7] == ‘7’)
square[7] = mark;
else if (choice == 8 && game[8] == ‘8’)
square[8] = mark;
else if (choice == 9 && game[9] == ‘9’)
square[9] = mark;
else
{
printf(“Invalid move “);player–;
getch();
}
i = win();
player++;
}
if (i == 1)
printf(” It is Player %d win “, –player);
else
printf(“It is a Game draw”);getch();
return 0;
}
int win()
{
if (game[1] == game[2] && game[2] == game[3])
return 1;
else if (game[4] == game[5] && game[5] == game[6])
return 1;
else if (game[7] == game[8] && game[8] == game[9])
return 1;
else if (game[1] == game[4] && game[4] == game[7])
return 1;
else if (game[2] == game[5] && game[5] == game[8])
return 1;
else if (game[3] == game[6] && game[6] == game[9])
return 1;
else if (game[1] == game[5] && game[5] == game[9])
return 1;
else if (game[3] == game[5] && game[5] == game[7])
return 1;
else if (game[1] != ‘1’ && game[2] != ‘2’ && game[3] != ‘3’ && game[4] != ‘4’ && game[5] != ‘5’ && game[6] != ‘6’ && game[7] != ‘7’ && game[8] != ‘8’ && game[9] != ‘9’)
return 0;
else
return – 1;
}
/* Code For Display*/
void board()
{
system(“cls”);
printf(“\n\n\tTic Tac Toe\n\n”);printf(
“Player 1 (X) – Player 2 (O)\n\n\n”);printf(
” | | \n”);
printf(” %c | %c | %c \n”, game[1], game[2], game[3]);printf(
“_____|_____|_____\n”);
printf(” | | \n”);printf(
” %c | %c | %c \n”, game[4], game[5], game[6]);printf(
“_____|_____|_____\n”);
printf(” | | \n”);printf(
” %c | %c | %c \n”, game[7], game[8], game[9]);printf(
” | | \n\n”);
}
हिंदी माध्यम नोट्स
Class 6
Hindi social science science maths English
Class 7
Hindi social science science maths English
Class 8
Hindi social science science maths English
Class 9
Hindi social science science Maths English
Class 10
Hindi Social science science Maths English
Class 11
Hindi sociology physics physical education maths english economics geography History
chemistry business studies biology accountancy political science
Class 12
Hindi physics physical education maths english economics
chemistry business studies biology accountancy Political science History sociology
English medium Notes
Class 6
Hindi social science science maths English
Class 7
Hindi social science science maths English
Class 8
Hindi social science science maths English
Class 9
Hindi social science science Maths English
Class 10
Hindi Social science science Maths English
Class 11
Hindi physics physical education maths entrepreneurship english economics
chemistry business studies biology accountancy
Class 12
Hindi physics physical education maths entrepreneurship english economics