Permalink
Browse files

almost there

  • Loading branch information...
1 parent e99b3b8 commit 3b74f27bf5a691532879fd5805481b3b4fa54a9d @binaryorganic committed Jun 21, 2011
Showing with 15 additions and 5 deletions.
  1. +15 −5 onehanded.js
View
@@ -17,7 +17,9 @@
*/
var word = 0;
-
+ isLeft = false;
+ isRight = false;
+ isBoth = false;
@@ -74,7 +76,7 @@ function loop2() { // Second Loop: pull a letter from each word and send it to
letter = 0;
- while (letter < wordlist[word]) {
+ while (letter < wordlist[word].length) {
loop3();
letter++
}
@@ -92,13 +94,21 @@ function loop3() { // Third Loop: compare pulled letter to each letter in the ri
function compare() { // Where we actually check each letter against the right-handed array and (for now) set a variable that tells us what hand a word is
- alert('test')
+
+
+ if (wordlist[word].substr(letter, 1) == right[handCheck]) {
+
+ isRight = true;
+ }
+ else {
+ isLeft = true;
+ }
}
function debug5() { //debugging the above functions
- alert('word = '+word);
- alert('letter = '+letter);
+ alert(wordlist[word].substr(letter, 1));
+ alert(right.substr[handCheck](1, 1));
}

0 comments on commit 3b74f27

Please sign in to comment.