summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorjules <jules@okfoc.us>2014-01-07 18:45:22 -0500
committerjules <jules@okfoc.us>2014-01-07 18:45:22 -0500
commitcce4f73a1637d54ab7c096815864a2c9c66fda65 (patch)
tree76c3e9964ddcb34e8c82835a13029a40681a10ea /js
parentb7c1ec511fc3afcf04321751fc8e0d9858b2dcd5 (diff)
xor
Diffstat (limited to 'js')
-rw-r--r--js/util.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/js/util.js b/js/util.js
index 948b3f6..b728377 100644
--- a/js/util.js
+++ b/js/util.js
@@ -42,6 +42,7 @@ function randint(n){ return rand(n)|0 }
function choice(a){ return a[randint(a.length)] }
function deg(n){ return n*180/PI }
function rad(n){ return n*PI/180 }
+function xor(a,b){ a=!!a; b=!!b; return (a||b) && !(a&&b) }
function pixel(x,y){ return 4*(mod(y,h)*w+mod(x,w)) }
function rgbpixel(d,x,y){
var p = pixel(~~x,~~y)