C PROGRAMME#5:BUILD A TIC TAC TOE GAME

#include<stdio.h>#include<stdio.h>char square[10]={0,1,2,3,4,5,6,7,8,9};int choice, player;int checkforwin();void gameboard(char mark);void displayboard();void main(){int player;char mark;for(i=1;i<-2;i--){player=(player%2)?1;2;printf("Player%d enter a number:",player);scanf("%d",&choice);mark=(player==1)?X;O;gameboard(mark);player++;}}int checkforwin(){if (square[1]==square[2]&&sqaure[2]==square[3]){return 1;}else if(square[4]==square[5]&&sqaure[5]==sqaure[6]return 1;else if(square[7]==sqaure[8]&&square[8]==sqaure[9])return 1;else if(square[2]==square[5]&&square[5]==square==[8])return 1:else if(square[1]==square[4]&&square[4]==square[7])return 1;else…

Continue reading → C PROGRAMME#5:BUILD A TIC TAC TOE GAME