Skip to content
Browse files

fazendo os testes passarem

  • Loading branch information...
1 parent f67ab68 commit 556f62e146c4c36e4db703b06c0951a0d0e8334b @HugoLnx committed
Showing with 6 additions and 11 deletions.
  1. +6 −11 mapa.js
View
17 mapa.js
@@ -3,17 +3,12 @@ Mapa = function (matriz){
this.proxima_coordenada = [];
this.passo = function (x){
-
-// if (<matriz[1][1] > matriz[1][0] )
-// this.proxima_coordenada = [0,1];
- if (matriz[1][1] > matriz[1][0])
- this.proxima_coordenada = [1,0];
- else
- this.proxima_coordenada = [1,1];
- if (matriz[0][1]< this.proxima_coordenada)
- this.proxima_coordenada = [0,1];
-
-
+ menor = [0,1];
+ if (matriz[menor[0]][menor[1]] > matriz[1][1])
+ menor = [1,1];
+ if (matriz[menor[0]][menor[1]] > matriz[1][0])
+ menor = [1,0];
+ this.proxima_coordenada = menor
};
}

0 comments on commit 556f62e

Please sign in to comment.
Something went wrong with that request. Please try again.