From 5701e8eeca777f55caff46c63b0fc68439da59ca Mon Sep 17 00:00:00 2001 From: Holden Rohrer Date: Fri, 17 Jul 2020 10:24:43 -0400 Subject: now always clears all words in block but maintains lecture --- examples/nword.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'examples/nword.js') diff --git a/examples/nword.js b/examples/nword.js index d42d0d4..5012bea 100644 --- a/examples/nword.js +++ b/examples/nword.js @@ -62,16 +62,15 @@ function makeclean(resp, reg){ let response = new Space().adhoc(resp); let regex = new RegExp(reg,'g'); function clean(coord, send, space){ - let out; + let out = new Space().adhoc(space.print().replace(regex, + match=>' '.repeat(match.length))); if (!lecture[send]){ response.loc = coord; - out = response; + out.comb(response, comb.add); lecture[send] = true; setTimeout(() => {delete lecture[send];}, 1000); - }else{ - out = new Space().adhoc(space.print().replace(regex, - match=>' '.repeat(match.length))).comb(space, comb.sub); } + out.comb(space, comb.sub); ids.push(wq.enqueue(out.towrite())); idcall.push(() => {search.update(response);}); } -- cgit