busca-palabras
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "busca-palabras", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"main": "./src/buscapalabrasengine.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -27,3 +27,4 @@ class BuscaPalabrasEngine { | ||
} | ||
log(`\nsolucion:\n ${JSON.stringify(this.solucion)}`); | ||
log(`\nsolucion:\n`); | ||
log(this.solucion); | ||
} | ||
@@ -48,3 +49,3 @@ | ||
// smallest square that will enclose them | ||
let deLetras = Math.ceil(Math.sqrt(sumaDeLetras*1.8)); | ||
let deLetras = Math.ceil(Math.sqrt(sumaDeLetras*1.2)); | ||
return Math.max(palabraMasLarga,deLetras,dimensionesSolicitadas||0); | ||
@@ -133,2 +134,4 @@ } | ||
rc += (avance.y>0?2:0); | ||
rc += (avance.x>0&&avance.y===0?1:0); | ||
rc += (avance.y>0&&avance.x===0?1:0); | ||
let match = this.verificaLetras(palabraArray,posicion,avance); | ||
@@ -135,0 +138,0 @@ if (match>0){ |
@@ -81,3 +81,3 @@ let assert = require('assert'); | ||
let rc = BuscaPalabrasEngine.calcularDimensionesOptimas(palabras); | ||
assert.strictEqual(rc,10); | ||
assert.strictEqual(rc,9); | ||
}); | ||
@@ -87,3 +87,3 @@ | ||
let rc = BuscaPalabrasEngine.calcularDimensionesOptimas(palabrasCortas); | ||
assert.strictEqual(rc,5); | ||
assert.strictEqual(rc,4); | ||
}); | ||
@@ -208,4 +208,4 @@ | ||
it ('prueba el output',()=>{ | ||
let cuadrado = new BuscaPalabrasEngine(['uno','dos']); | ||
it.only ('prueba el output',()=>{ | ||
let cuadrado = new BuscaPalabrasEngine(['uno','dos'],4); | ||
cuadrado.genera(); | ||
@@ -217,3 +217,4 @@ let result = ''; | ||
assert.strictEqual(result.includes('solucion:'),true); | ||
cuadrado.output(); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16228
427