Skip to content

Commit

Permalink
ie compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jkk committed Nov 19, 2008
1 parent f6038f8 commit 313a640
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions index.html
Expand Up @@ -78,9 +78,16 @@
return html;
}

function indexOf(arr, needle) {
for (var i = 0; i < arr.length; i++)
if (arr[i] === needle)
return i;
return -1;
}

function getCardIndex() {
var index;
while (typeof index == 'undefined' || pickedCardIndexes.indexOf(index) != -1)
var index = -1;
while (index == -1 || indexOf(pickedCardIndexes, index) != -1)
index = Math.floor(Math.random() * deck.length);
pickedCardIndexes.push(index);
return index;
Expand Down

0 comments on commit 313a640

Please sign in to comment.