diff options
author | Holden Rohrer <holden.rohrer@gmail.com> | 2019-12-27 14:29:02 -0500 |
---|---|---|
committer | Holden Rohrer <holden.rohrer@gmail.com> | 2019-12-27 14:29:02 -0500 |
commit | 359d4b232ba90ccde86339abe1707c5fd6504ed9 (patch) | |
tree | fc4addc78887400fd33e973f73cefebd33f86b0c /examples | |
parent | 8277732846f594547a0c8cfde4aa81f21396f393 (diff) |
in search, include vec and break ties in getComp
Diffstat (limited to 'examples')
-rw-r--r-- | examples/search.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/search.js b/examples/search.js index 982031c..b35c9b8 100644 --- a/examples/search.js +++ b/examples/search.js @@ -4,11 +4,12 @@ const bs = require('binary-search'); const Space = require('../space'); -const comb = require('../utils/comb.js') -const getdims = require('../utils/getdims.js'); +const comb = require('../utils/comb') +const getdims = require('../utils/getdims'); +const vec = require('../utils/vec'); function getComp(index){ - return (element,needle) => element[index] - needle[index]; + return (element,needle) => (element[index] - needle[index] || element[1-index] - needle[1-index]) } function tileToChar(coord){ |