Skip to content

Commit

Permalink
prevent negative answers for subtraction questions
Browse files Browse the repository at this point in the history
  • Loading branch information
barelyknown committed Dec 18, 2015
1 parent 40de00c commit c53ed4b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ export default Ember.Controller.extend({
termOne = t[uniqueRandomIndexes[problems.length]][0];
termTwo = t[uniqueRandomIndexes[problems.length]][1];
break;
case '-':
termOne = Math.floor(Math.random() * (10 + 1));
termTwo = Math.floor(Math.random() * (termOne + 1));
break;
default:
termOne = Math.floor(Math.random() * 10);
termTwo = Math.floor(Math.random() * 10);
Expand Down

0 comments on commit c53ed4b

Please sign in to comment.