From 24e14950fed8f7396253637fb6657c6d6072efa7 Mon Sep 17 00:00:00 2001 From: Holden Rohrer Date: Wed, 18 Dec 2019 23:37:08 -0500 Subject: finished sparse collector --- examples/jarvis.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'examples') diff --git a/examples/jarvis.js b/examples/jarvis.js index f31a9ea..ccf1f80 100644 --- a/examples/jarvis.js +++ b/examples/jarvis.js @@ -28,10 +28,16 @@ main.on('identity', (sender) => { console.log('identity activated'); main.on('tileUpdate', (send, source, tiles) => { if (send == sender) return; - let dim = tilekeys(tiles); - let data = new Space(); data.fromfetch(tiles, [dim[0][0],dim[0][1],dim[0][0],dim[0][1]],conform=false); - console.log(data.print()); - //let data = new Space(); data.fromfetch(tiles, dim); - //data.search - }) -}) + let locs = tilekeys(tiles); + for (let i=0; i{delete read[dim]},30000), + "block":new Space(), + }); + read[loc].block.fromfetch(tiles, [loc[0][0], loc[0][1], loc[1][0], loc[1][1]], conform=false); + // TODO : if any pair or quadruplet of blocks are adjacent, SEARCH THEM! + } + }); +}); -- cgit