From de95e5bd4c3f5e73e1cfa329d545c4065a89f7c7 Mon Sep 17 00:00:00 2001 From: ahsanbarkati Date: Fri, 27 Jan 2017 15:36:47 +0530 Subject: [PATCH 1/9] Create try --- try | 1 + 1 file changed, 1 insertion(+) create mode 100644 try diff --git a/try b/try new file mode 100644 index 0000000..30ba5bb --- /dev/null +++ b/try @@ -0,0 +1 @@ +making a new file in my brach and sending pull request to the master branch From 2f775d2c626b51cfb3cf1a1c5b28e95a46badd1c Mon Sep 17 00:00:00 2001 From: Ahsan Barkati Date: Mon, 30 Jan 2017 19:16:13 +0530 Subject: [PATCH 2/9] com --- try | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/try b/try index 30ba5bb..0436afe 100644 --- a/try +++ b/try @@ -1 +1 @@ -making a new file in my brach and sending pull request to the master branch +making a new file in my brach and sending pull request to the master branch....yesss From eb2f2921c6f7bd4e732e62cc4e947dfe657369af Mon Sep 17 00:00:00 2001 From: ahsanbarkati Date: Mon, 30 Jan 2017 19:21:25 +0530 Subject: [PATCH 3/9] Update try --- try | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/try b/try index 0436afe..e32759b 100644 --- a/try +++ b/try @@ -1 +1,4 @@ -making a new file in my brach and sending pull request to the master branch....yesss +git remote add Ahsan https://github.com/ahsanbarkati/ACA_Haskell.git +git push serversbrnchname loclbrnchname +git pull +git push From 6674484a227b205f361698668338bd431417d189 Mon Sep 17 00:00:00 2001 From: ahsanbarkati Date: Mon, 30 Jan 2017 19:24:07 +0530 Subject: [PATCH 4/9] Update try --- try | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/try b/try index e32759b..9808d5e 100644 --- a/try +++ b/try @@ -1,4 +1,4 @@ git remote add Ahsan https://github.com/ahsanbarkati/ACA_Haskell.git git push serversbrnchname loclbrnchname -git pull +git pull git push From facd2f9ed2c3372a1ac38767e361e1e7e11dabfa Mon Sep 17 00:00:00 2001 From: abhiyad Date: Wed, 1 Feb 2017 06:07:00 -0500 Subject: [PATCH 5/9] via terminal --- pushed.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 pushed.txt diff --git a/pushed.txt b/pushed.txt new file mode 100644 index 0000000..40798c9 --- /dev/null +++ b/pushed.txt @@ -0,0 +1 @@ +THis file is pushed Via Terminal From 82ff8dc3f82a76ef777e68c236451a23b032a4b1 Mon Sep 17 00:00:00 2001 From: abhiyad Date: Thu, 2 Feb 2017 22:57:12 +0530 Subject: [PATCH 6/9] factorial using haskell --- factorial.hs | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 factorial.hs diff --git a/factorial.hs b/factorial.hs new file mode 100644 index 0000000..a8e63e9 --- /dev/null +++ b/factorial.hs @@ -0,0 +1,4 @@ +main = print (fac 50) + +fac 0 = 1 +fac n = n * fac (n-1) From d23beee1ec7d38e829c4161dac236746b8a76507 Mon Sep 17 00:00:00 2001 From: Abhishek Yadav Date: Sat, 11 Feb 2017 00:29:58 +0530 Subject: [PATCH 7/9] Create tic_tac_toe_InC an Interface for TicTacToe in C --- tic_tac_toe_InC | 97 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 tic_tac_toe_InC diff --git a/tic_tac_toe_InC b/tic_tac_toe_InC new file mode 100644 index 0000000..619e7c0 --- /dev/null +++ b/tic_tac_toe_InC @@ -0,0 +1,97 @@ +#include +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++; +} +} + + + + + + + + + + From db877bcd64bdbb64dd58ec577c157bedddcae7d8 Mon Sep 17 00:00:00 2001 From: Abhishek Yadav Date: Sat, 18 Mar 2017 21:44:49 +0530 Subject: [PATCH 8/9] Only 3x3 --- Tictactoe HAskell | 57 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Tictactoe HAskell diff --git a/Tictactoe HAskell b/Tictactoe HAskell new file mode 100644 index 0000000..8848476 --- /dev/null +++ b/Tictactoe HAskell @@ -0,0 +1,57 @@ +sm a x y c=do + let check1 =0 + let check2 =0 + let check3 =0 + let check4 =0 + let check5 =0 + let check6 =0 + let check7 =0 + let check8 =0 + if (a!!x!!y/=2) + then do + print "INVALID COORDINATES!! enter unfilled coordinates" + y<-getLine + x<-getLine + sm a (read x::Int) (read y::Int) c + else return() + + let row=a!!y + let p1=take x row + let p2= drop (x+1) row + let nrow=p1++[c `mod` 2]++p2 + let py1=take y a + let py2=drop (y+1) a + let f=py1++[nrow]++py2 + print (f!!0) + print (f!!1) + print (f!!2) + let b = c+1 + check1 <- if (f!!0!!0==f!!0!!1)&&(f!!0!!1==f!!0!!2)&&(f!!0!!2/=2) then return (1) else return (0) + check2 <- if (f!!1!!0==f!!1!!1)&&(f!!1!!1==f!!1!!2)&&(f!!1!!2/=2) then return (1) else return (0) + check3 <- if (f!!2!!0==f!!2!!1)&&(f!!2!!1==f!!2!!2)&&(f!!2!!2/=2) then return (1) else return (0) + check4 <- if (f!!0!!0==f!!1!!0)&&(f!!2!!0==f!!1!!0)&&(f!!1!!0/=2) then return (1) else return (0) + check5 <- if (f!!0!!1==f!!1!!1)&&(f!!1!!1==f!!2!!1)&&(f!!2!!1/=2) then return (1) else return (0) + check6 <- if (f!!0!!2==f!!1!!2)&&(f!!2!!2==f!!1!!2)&&(f!!1!!2/=2) then return (1) else return (0) + check7 <- if (f!!0!!0==f!!1!!1)&&(f!!1!!1==f!!2!!2)&&(f!!2!!2/=2) then return (1) else return (0) + check8 <- if (f!!0!!2==f!!1!!1)&&(f!!1!!1==f!!2!!0)&&(f!!2!!0/=2) then return (1) else return (0) + let check = check1+check2+check3+check4+check5+check6+check7+check8 + if (check/=0) + then do + print "Game Over" + print (c `mod` 2) + print "Wins" + else return() + print "Please enter x and y coordinates for next turn " + y<-getLine + x<-getLine + if (check==0) then sm f (read x::Int) (read y::Int) b else print ("GAME OVER ") + +main=do + let f=[[2,2,2],[2,2,2],[2,2,2]] + print (f!!0) + print (f!!1) + print (f!!2) + print "Please enter x and y coordinates for first turn " + x<-getLine + y<-getLine + sm f (read x::Int) (read y::Int) 0 From 9c28cbf49269fd74ac8d3a1809c5e7e878cd09e3 Mon Sep 17 00:00:00 2001 From: Abhishek Yadav Date: Sat, 18 Mar 2017 21:45:44 +0530 Subject: [PATCH 9/9] Sin function till Tn is less than Error value Taylor Series --- SinError | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 SinError 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