From a222d88a13afc1b0f763f5d800fdda1426967bf4 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 27 Apr 2017 08:10:10 -0400 Subject: convert between notes and indices correctly --- client/lib/util.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'client/lib/util.js') diff --git a/client/lib/util.js b/client/lib/util.js index b2d95f5..7c3082d 100644 --- a/client/lib/util.js +++ b/client/lib/util.js @@ -1,3 +1,4 @@ function choice (a){ return a[ Math.floor(Math.random() * a.length) ] } +function mod(n,m){ return n-(m * Math.floor(n/m)) } -export { choice } \ No newline at end of file +export { choice, mod } -- cgit v1.2.3-70-g09d2