Posts

Showing posts with the label C Game Program

Tic-Tac-Toe game program in C (C भाषा में Tic-Tac-Toe गेम प्रोग्राम)

Tic-Tac-Toe is a simple two-player game played on a 3×3 grid. Players take turns marking the grid with X and O. The first player to get three marks in a row, column, or diagonal wins. Tic-Tac-Toe दो खिलाड़ियों का एक सरल गेम है, जो 3×3 Grid पर खेला जाता है। खिलाड़ी बारी-बारी से X और O लगाते हैं। जो खिलाड़ी एक ही Row, Column या Diagonal में तीन Marks बना लेता है, वह गेम जीत जाता है। C Program #include <stdio.h> int main() { char data[9] = {'1','2','3','4','5','6','7','8','9'}; int index, count = 0, winner = 0; int player = 1; char sign; while (count < 9) { /* Display the board */ printf("\n"); printf(" %c | %c | %c \n", data[0], data[1], data[2]); printf("---+---+---\n"); printf(" %c | %c | %c \n", data[3], data[4], data[5]); printf("---+---+---\n"); printf(" %c | %c | %c \...