tic toe game - #include<stdio.h>...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 #include<stdio.h> #include<conio.h> void Board() void PlayerX() void PlayerO() void Player_win() void check() int win=0,wrong_X=0,wrong_O=0,chk=0 char name_X[30] char name_O[30] int pos_for_X[3][3] int pos_for_O[3][3] int pos_marked[3][3] void main() { int i,ch,j char ans /*clrscr() printf("\n\t\t\t\tTIC TAC TOE") printf("\n\t\t\t\t") for(i=1 i<=11 i++) { delay(10000) printf("*") }*/ do { clrscr() printf("\n\t\t\t\tTIC TAC TOE") printf("\n\t\t\t\t") for(i=1 i<=11 i++) { delay(10000) printf("*") } printf("\n1.Start The Game") printf("\n2.Quit The Game") printf("\nEnter your choice(1-2) : ") switch(ch) { case 1: chk=0 win=0 for(i=1 i<=3 i++) { for(j=1 j<=3 j++) { pos_for_X[i][j]=0
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sheet1 Page 2 pos_for_O[i][j]=0 pos_marked[i][j]=0 } } printf("\n\n") clrscr() printf("\nEnter the name of the player playing for \'X\': ") fflush(stdin) gets(name_X) printf("\nEnter the name of the player playing for \'O\': ") fflush(stdin) gets(name_O) Board() for( ) { if(win==1) break check() if(chk==9) { printf("\n\t\t\tMATCH DRAWS!!") printf("\nPress any key. ...") break } else chk=0 printf("\nTURN FOR %s:",name_X)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

tic toe game - #include&lt;stdio.h&gt;...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online