Browse files

comments in onehanded.js

  • Loading branch information...
1 parent 1a51cd9 commit 628b2a13ab43ff86029dad8eb4550072ec9599da @binaryorganic committed Jun 19, 2011
Showing with 31 additions and 0 deletions.
  1. +31 −0 onehanded.js
@@ -0,0 +1,31 @@
+ Basic flowchart of what's needed:
+- an array of words to parse through
+- an array for both left and right handed letters
+- loop #1 to pull a word from the dictionary and run loop #2 and #3
+- loop #2 to pull a letter from the word selected by loop #1
+- lopp #3 to cycle each letter pulled by loop #3 through a comparison of each value in the handedness arrays
+ Also, it just occured to me that maybe we just need one handedness array?
+ If we only check say, the right hand (because it's shorter), three things
+ are possible. 1-every character is a match (a right-handed word) 2-some
+ characters are a match (a two-handed word) or 3-no characters match (a
+ left-handed word).
+ Thoughts?
+// build handedness arrays
+var left = ["q", "w", "e", "r", "t", "a", "s", "d", "f", "g", "z", "x", "c", "v", "b"]; //left-handed letters
+var right = ["m", "n", "h", "j", "k", "l", "p", "o", "i", "u", "y", "b"]; //right-handed letters
+/* we need to make a decision one way or the other for handling of "b"
+It's present at the end of both arrays at the moment. For that to work,
+we need to write the verification function to not cross-reference the
+other array. It should be enough to say that if every letter exists in
+one array or the other we've got a match, so this shouldn't be a problem.
+The other option would be to leave "b" out of both and just skip it
+through an else statement or something, but I think it's fine as it. */

0 comments on commit 628b2a1

Please sign in to comment.