aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/nword.js9
1 files changed, 4 insertions, 5 deletions
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);});
}