Commit 9e3be20b 9e3be20b926efb9e54e855a9fbb416bdee65aedf by Vincent Peybernes

Implement addVotes

1 parent 71555bf1
Pipeline #16 for 9e3be20b failed in 21 seconds
...@@ -82,7 +82,14 @@ ...@@ -82,7 +82,14 @@
82 candidate.votes.push(i); 82 candidate.votes.push(i);
83 } 83 }
84 }; 84 };
85 RelativePlacement.prototype.addVotes = function () {}; 85
86 /**
87 *
88 * @param {String[][]} votes
89 */
90 RelativePlacement.prototype.addVotes = function (votes) {
91 votes.forEach(vote => this.addVote(vote));
92 };
86 RelativePlacement.prototype.getResult = function () { 93 RelativePlacement.prototype.getResult = function () {
87 return relativePlacement(this.votes, this.candidateList); 94 return relativePlacement(this.votes, this.candidateList);
88 }; 95 };
......