Browse Source

Partially integrated with iTarefa
-Lacking tests

Bernardo 5 years ago
parent
commit
d3b87b220a
3 changed files with 4 additions and 16 deletions
  1. 3 4
      js/iHanoiFunctions.js
  2. 1 1
      js/integration-functions.js
  3. 0 11
      teste.ihn~

+ 3 - 4
js/iHanoiFunctions.js

@@ -5,7 +5,7 @@ var canvas = document.getElementById('planoDeFundo');
 			var idF=" ", idT= " ";
 			var nMovements = 0, nWrongMoves=0, nDisks;
 			var moves=""; //string to save movements
-			var acertos;
+			var acertou=0;
 			var optimalSolution;
 					 	//NavyBlue  Lime     Fuchsia   yellow   Orange   LightSteelBlue  red
 			var colors = ["#000080","#00FF00", "#FF00FF", "yellow", "#FFA500", "#B0C4DE","red"];
@@ -170,9 +170,8 @@ var canvas = document.getElementById('planoDeFundo');
 					nMovements++;
 					drawScene();
 				}
-				acertos=0;
 				if(towerC.length == nDisks && nDisks!=0){
-					acertos=1;
+					acertou=1;
 					totalTime= Date.now() - start;
 					if(nMovements==optimalSolution){
 						alert("You Won in the least amount of movements!!!\nCongratulations!!!");
@@ -207,4 +206,4 @@ var canvas = document.getElementById('planoDeFundo');
 			    ctx.fill();
 			  }        
 			}
-			inicio(4);
+			//inicio(4);

+ 1 - 1
js/integration-functions.js

@@ -59,7 +59,7 @@ function getiLMContent() {
 
         // Uma vez que os dados foram recebidos, o método "organizaAtividade" é chamado.
         // Observe que esse método faz parte do arquivo js/iarithmetic-functions.js
-        organizaAtividade(JSON.parse(d));
+        inicio(JSON.parse(d));
 
     });
 }

+ 0 - 11
teste.ihn~

@@ -1,11 +0,0 @@
-# ihanoi: http://www.matematica.br!
-Discs: 3
-Size: 7
-Movements:
-A C ;
-A B ;
-C B ;
-A C ;
-B A ;
-B C ;
-A C ;