From 359d4b232ba90ccde86339abe1707c5fd6504ed9 Mon Sep 17 00:00:00 2001 From: Holden Rohrer Date: Fri, 27 Dec 2019 14:29:02 -0500 Subject: in search, include vec and break ties in getComp --- examples/search.js | 7 ++++--- 1 file 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){ -- cgit