Permalink
Browse files

messy broken code

  • Loading branch information...
1 parent e2d571d commit e99b3b8de508b971adee6649656b32b0ac0f7429 @binaryorganic committed Jun 21, 2011
Showing with 54 additions and 2 deletions.
  1. +6 −1 index.html
  2. +48 −1 onehanded.js
View
@@ -19,7 +19,12 @@
<button onclick="debug2()">cycle through letters of first word</button>
<button onclick="debug3()">tell me if 3rd word is right-handed</button>
<button onclick="debug4()">test nested while loops</button>
-<button onclick="run()">undefined</button>
+<button onclick="debug5()">debug the main function</button>
+
+<span id="debug"><p></p></span>
+
+<script>document.getElementById("debug").firstChild.nodeValue = word;</script>
+
</body>
View
@@ -16,6 +16,9 @@
Thoughts?
*/
+var word = 0;
+
+
// build handedness arrays
@@ -55,7 +58,51 @@ function debug2() {
}
-//TESTING A SINGLE WORD (not done yet)
+//mmmmm... just gonna try to write the whole thing here and see what happens...
+
+function debug3() { // First Loop: pull a word and send it to the second loop. We'll keep doing this until we've gone through all the words in the array
+
+ word = 0;
+
+ while (word < wordlist.length) {
+ loop2();
+ word++
+ }
+}
+
+function loop2() { // Second Loop: pull a letter from each word and send it to loop 3.
+
+ letter = 0;
+
+ while (letter < wordlist[word]) {
+ loop3();
+ letter++
+ }
+}
+
+function loop3() { // Third Loop: compare pulled letter to each letter in the right-handed array
+
+ handCheck = 0;
+
+ while (handCheck < right.length) {
+ compare();
+ handCheck++
+ }
+}
+
+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')
+}
+
+function debug5() { //debugging the above functions
+
+ alert('word = '+word);
+ alert('letter = '+letter);
+}
+
+
+

0 comments on commit e99b3b8

Please sign in to comment.