From 9ae02ad2c2676a5991c6c952952fc6fcfdb96304 Mon Sep 17 00:00:00 2001 From: Holden Rohrer Date: Fri, 27 Dec 2019 14:52:19 -0500 Subject: integrated .loc with space.fetch (and dependencies) --- examples/search.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'examples') 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){ -- cgit