aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorHolden Rohrer <holden.rohrer@gmail.com>2019-12-27 14:52:19 -0500
committerHolden Rohrer <holden.rohrer@gmail.com>2019-12-27 14:52:19 -0500
commit9ae02ad2c2676a5991c6c952952fc6fcfdb96304 (patch)
tree7f255b2eaaf9ee7c5cd532397f960001afb25b01 /examples
parent310165f74d17631cfaaadc71e55000303ba0262d (diff)
integrated .loc with space.fetch (and dependencies)
Diffstat (limited to 'examples')
-rw-r--r--examples/search.js8
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){