From cc1320ecab312294c3f01cecca573450f39cf574 Mon Sep 17 00:00:00 2001 From: Sahil Lamba Date: Fri, 15 Aug 2014 01:40:24 +0530 Subject: [PATCH] Reverted to earlier code. Undefined bug to be fixed. --- js/expert.js | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/js/expert.js b/js/expert.js index ecaf2d5..d84aede 100644 --- a/js/expert.js +++ b/js/expert.js @@ -15,16 +15,6 @@ grid[5] = new Array(9); grid[6] = new Array(9); grid[7] = new Array(9); -for(var fix=0; fix<=9; fix++){ - grid[0][fix]=20; - grid[7][fix]=25; -} - -for(var fix2 = 0; fix2 <= 7; fix2++){ - grid[fix2][0]=30; - grid[fix2][8]=35; -} - grid[0][0]=-100; @@ -1043,7 +1033,7 @@ function AIMove(){ a=l-1, b=i; - if(a > 1 &&b <= 6){ + if(a>1 && b<7){ gridc[l][i]=0; gridc[a][b]=1; columnsCopy[i]--; @@ -1110,7 +1100,7 @@ function AIMove(){ var counter6 = 0, direction6 = 5; - if(a > 1 &&b <= 6){ + if(a > 1 && b < 6){ gridc[l][i]=0; gridc[l-1][i]=1; @@ -1244,7 +1234,7 @@ function AIMove(){ a=l2, b=k; - if(a > 1 &&b <= 6){ + if(a > 1 && b < 6){ counter2 = 0, direction2 = 5; @@ -1304,7 +1294,7 @@ function AIMove(){ var counter6 = 0, direction6 = 5; - if(a > 1 &&b <= 6){ + if(a>1&&b<7){ if (gridc[a][b] === gridc[a + 1][b + 1]) { @@ -1433,7 +1423,7 @@ function AIMove(){ - if(a > 1 &&b <= 6){ + if(a > 1 && b < 6){ counter2 = 0, direction2 = 5; @@ -1490,7 +1480,7 @@ function AIMove(){ var counter6 = 0, direction6 = 5; - if(a > 1 &&b <= 6){ + if(a > 1 && b < 6){ if (gridc[a][b] === gridc[a + 1][b + 1]) { counter6 += 1; @@ -1618,7 +1608,7 @@ function AIMove(){ - if(a > 1 &&b <= 6){ + if(a > 1 && b < 6){ counter2 = 0, direction2 = 5; @@ -1675,7 +1665,7 @@ function AIMove(){ var counter6 = 0, direction6 = 5; - if(a > 1 &&b <= 6){ + if(a>1&&b<7){ if (gridc[a][b] === gridc[a + 1][b + 1]) { counter6 += 1; @@ -1809,7 +1799,7 @@ function AIMove(){ - if(a > 1 &&b <= 6){ + if(a>1 && b<7){ counter2 = 0, direction2 = 5; @@ -1866,7 +1856,7 @@ function AIMove(){ var counter6 = 0, direction6 = 5; - if(a > 1 &&b <= 6){ + if(a>1&&b<7){ if (gridc[a][b] === gridc[a + 1][b + 1]) { counter6 += 1;