diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-02-25 16:47:46 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-02-25 16:47:46 +0100 |
| commit | 5e4a56bdfed89fa547bbcd520372f67cab18dac5 (patch) | |
| tree | a8e1bce68ca796f3381be4603dbb8746c6acc3ce /client | |
| parent | 19eb1c9c11dde34ecbc6ee0053aa86612ba72cfc (diff) | |
noise
Diffstat (limited to 'client')
| -rw-r--r-- | client/index.js | 14 |
1 files changed, 8 insertions, 6 deletions
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 } } |
