From 75dc7995996fa27a06c9a441397b476797f320c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Nison?= Date: Sun, 3 Nov 2019 11:01:46 +0100 Subject: [PATCH] Fixes bug where a participant was chosen twice --- SecretSanta.js | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SecretSanta.js b/SecretSanta.js index 524d94a..1875ee4 100644 --- a/SecretSanta.js +++ b/SecretSanta.js @@ -62,7 +62,7 @@ SecretSanta.prototype.generate = function () { } ); - pairings[ name ] = this.enforced[ name ]; + candidatePairings[ name ] = [ this.enforced[ name ] ]; } else { diff --git a/index.html b/index.html index b79f93a..564de49 100755 --- a/index.html +++ b/index.html @@ -372,7 +372,7 @@ return error( 'Syntax error: "' + lines[ t ] + '" isn\'t valid' ); var name = match[ 1 ]; - var rules = match[ 2 ] ? match[ 2 ].match(/[!=][^!=]+/) : null; + var rules = match[ 2 ] ? match[ 2 ].match(/[!=][^!=]+/g) : null; var person = santa.add( name );