Permalink
Browse files

No idea how that random selection was even working

  • Loading branch information...
1 parent 4be2a18 commit f521d5f3005f7e335e06736836f26120f6392f2e @lmorchard committed Sep 5, 2009
Showing with 3 additions and 2 deletions.
  1. +1 −0 TODO.md
  2. +2 −2 src/app/assistants/home-assistant.js
View
@@ -3,3 +3,4 @@
* Fifth edition of cards
* Graphical cards?
* Update sets from web
+* Swipe to next card?
@@ -116,10 +116,10 @@ HomeAssistant.prototype = (function () { /** @lends HomeAssistant# */
showNewStrategy: function (edition_num) {
var editions = ObliqueStrategies.strategies;
if (!edition_num) {
- edition_num = Math.round(Math.random() * [editions.length-1]);
+ edition_num = Math.floor(Math.random() * editions.length);
}
var edition = editions[edition_num],
- strategy = edition[Math.round(Math.random() * [edition.length-1])];
+ strategy = edition[Math.floor(Math.random() * edition.length)];
this.controller.get('strategy').update(strategy);
},

0 comments on commit f521d5f

Please sign in to comment.