diff --git a/SinError b/SinError new file mode 100644 index 0000000..b2732d6 --- /dev/null +++ b/SinError @@ -0,0 +1,27 @@ +fac 0 = 1 +fac n = n * fac (n-1) +pow x 0 = 1 +pow x n = x*(pow x (n-1)) +computer e n x cursum = do + let an=(pow x (2*n-1)) + let bn=(fac (2*n-1)) + let cn=(pow (-1) (n+1)) + let tn=cn*an/bn + if(e +int arr[3][3]; +int options[9]; +int choice; +int x[9]; +int y[9]; +int pass=1; +void initialize() +{ + int i,j; + for(i=0;i<3;i++) + { + for(j=0;j<3;j++) + { + arr[i][j]=0; + } + } +} + + +void printing() +{ + int i,j; + for(i=0;i<3;i++) + { + for(j=0;j<3;j++) + { if(arr[i][j]==1) + printf(" 0 "); + else if(arr[i][j]==2) + printf(" X "); + else + printf(" "); + } + printf("\n\n"); + } +} + + +void displayoptions() +{ + int c=1,i,j; + for(i=0;i<3;i++) + { + for(j=0;j<3;j++) + { + if((arr[i][j]!=1)&&(arr[i][j]!=2)) + { + printf("%d.(%d,%d)\n",c,i+1,j+1); + x[c-1]=i; + y[c-1]=j; + options[c-1]=c++; + } + } + } + printf("Enter Your Choice "); + scanf("%d",&choice); +pass++; + +} + + +int update() +{ +if(pass%2==0) +arr[x[choice-1]][y[choice-1]]=1; +else +arr[x[choice-1]][y[choice-1]]=2; +} + + +int main() +{ + +printf(" *-*-*-*-*-*-*- O has First turn *-*-*-*-*-*-*-*\n"); + +int i=0; + initialize(); + printing(); +while(i<10) +{ + displayoptions(); +update(); +printing(); + +i++; +} +} + + + + + + + + + + diff --git a/try b/try new file mode 100644 index 0000000..9808d5e --- /dev/null +++ b/try @@ -0,0 +1,4 @@ +git remote add Ahsan https://github.com/ahsanbarkati/ACA_Haskell.git +git push serversbrnchname loclbrnchname +git pull +git push