diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/search.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/search.js b/examples/search.js index 9e9d87a..73f29d0 100644 --- a/examples/search.js +++ b/examples/search.js @@ -32,9 +32,11 @@ function Search(searchBlock){ // searchBlock should be a Space object. }); let block = this.block(loc, inds); let searchspace = new Space(); - let root = vec.tileToChar(getdims(Array.from(block))[0]); - block.forEach( (tile) => {searchspace.comb(this.tiles[tile],comb.add,vec.add(vec.tileToChar(tile), vec.mult(root,-1)))}); - return searchspace.search(searchBlock); // According to space docs, [] on failure and a character location on success + block.forEach( (tile) => { + searchspace.comb( this.tiles[tile], comb.add ); + }); + coords = searchspace.search(searchBlock); // According to space docs, [] on failure and a character location on success + return vec.add(coords, searchspace.loc); } this.block = function(loc,inds,exclude){ |