From 5e4a56bdfed89fa547bbcd520372f67cab18dac5 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 25 Feb 2018 16:47:46 +0100 Subject: noise --- client/index.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'client') diff --git a/client/index.js b/client/index.js index 3a643a5..0b917ac 100644 --- a/client/index.js +++ b/client/index.js @@ -108,14 +108,16 @@ function white(){ return false }) } -function stripex(){ +function stripex(odd){ + odd = !! odd forEach((x,y,state) => { - return x % 2 + return x % 2 ? odd : !odd }) } -function stripey(){ +function stripey(odd){ + odd = !! odd forEach((x,y,state) => { - return y % 2 + return y % 2 ? odd : !odd }) } function noise(){ @@ -247,10 +249,10 @@ function keydown(e){ noise() break case 69: // e - stripex() + stripex(Math.random() < 0.5) break case 82: // r - stripey() + stripey(Math.random() < 0.5) break } } -- cgit v1.2.3-70-g09d2