473,806 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Code works with 4 letter words, but not random word length

tpgames
785 Contributor
I do not understand why this code does not work? It will show ????? for the word length, but will does not actually access the individual letters within the word list. I enter the vowels as guesses, and NONE of the vowels are said to be in the word. I'm trying to put the working code in a separate JS file, instead of having the silly thing on the same HTML page. This might allow me to incorporate user choosing which game to play within the same HTML page, if my other support issue gets resolved.
Thanks!

ps. The code appears to work if I have the JS on the same page as the HTML.

Erroroneous JS code
Expand|Select|Wrap|Line Numbers
  1. //characters can not be longer than 16 letters because browser will not show it.
  2. var can_play = true;
  3. var words = new Array("waschbecken","toilette","seife","badewanne","wasserhahn","handtuch","dusche","waschlappen","toilettenpapier","wasser","zahnpasta","zahnbürste");
  4.  
  5. var to_guess = "";
  6. var display_word = "";
  7. var used_letters = "";
  8. var wrong_guesses = 0;
  9.  
  10.  
  11. function selectLetter(l)
  12. {
  13. if (can_play == false)
  14. {
  15. return;
  16. }
  17.  
  18. if (used_letters.indexOf(l) != -1)
  19. {
  20. return;
  21. }
  22.  
  23. used_letters += l;
  24. document.game.usedLetters.value = used_letters;
  25.  
  26. if (to_guess.indexOf(l) != -1)
  27. {
  28.  // correct letter guess
  29. pos = 0;
  30. temp_mask = display_word;
  31.  
  32.  
  33. while (to_guess.indexOf(l, pos) != -1)
  34. {
  35. pos = to_guess.indexOf(l, pos);            
  36. end = pos + 1;
  37.  
  38. start_text = temp_mask.substring(0, pos);
  39. end_text = temp_mask.substring(end, temp_mask.length);
  40.  
  41. temp_mask = start_text + l + end_text;
  42. pos = end;
  43. }
  44.  
  45. display_word = temp_mask;
  46. document.game.displayWord.value = display_word;
  47.  
  48. if (display_word.indexOf("?") == -1)
  49. {
  50. // won
  51. alert("You've saved the Book from Evaporation! Congratulations, Mazel Tov and all that good stuff!");
  52. can_play = false;
  53. }
  54. }
  55. else
  56. {
  57. // incorrect letter guess
  58.  
  59. // 12 guesses
  60. wrong_guesses += 1;
  61. eval("document.hm.src=\"/gaming/2/word/evapbook/12/" + "hm" + wrong_guesses + ".gif\"");
  62.  
  63. if (wrong_guesses == 12)
  64. {
  65. // lost
  66. alert("Oh no! The Book is evaporating! Please try again!");
  67. can_play = false;
  68. }
  69. }
  70. }
  71.  
  72. function reset()
  73. {
  74. selectWord();
  75. document.game.usedLetters.value = "";
  76. used_letters = "";
  77. wrong_guesses = 0;
  78. document.hm.src="/gaming/2/word/evapbook/12/hmstart.gif";
  79.   var links = document.getElementsByTagName("a");   
  80.       for (i = 0; i < links.length; i++) {
  81.           links[i].style.color = "#0000ff";
  82.       }
  83. }
  84.  
  85. function selectWord()
  86. {
  87. can_play = true;
  88. random_number = Math.round(Math.random() * (words.length - 1));
  89. to_guess = words[random_number];
  90. //document.game.theWord.value = to_guess;
  91.  
  92. // display masked word
  93. masked_word = createMask(to_guess);
  94. document.game.displayWord.value = masked_word;
  95. display_word = masked_word;
  96. }
  97.  
  98. function createMask(m)
  99. {
  100. mask = "";
  101. word_length = m.length;
  102.  
  103.  
  104. for (i = 0; i < word_length; i ++)
  105. {
  106. mask += "?";
  107. }
  108. return mask;
  109. }
  110.  
  111.  
The HTML code:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  3. <html lang="utf-8">
  4. <head>
  5. <title> Scrambled Words </title>
  6.  
  7. <META http-equiv="expires" content="Thur, 1 March 2007 13:00:00 GMT">
  8. <meta http-equiv="Content-Type" content="text/html charset=utf-8">
  9. <link type="text/css" rel="stylesheet" 
  10. href="http://www.globalwritersclub.com/gaming/2/word/scrambled/css/scrambled.css"> 
  11.  
  12. <script language="Javascript" src="http://www.globalwritersclub.com/gaming/2/word/evapbook/eb/de/js/1a.js"></script>
  13.  
  14. <!-- script originally by Chris Fortey @ http://www.c-g-f.net -->
  15.  
  16.  
  17. </HEAD>
  18.  
  19. <body onLoad="reset(); return true;">
  20.  
  21. <table border="0" cellpadding="0" cellspacing="0" width="100%" Summary="NAV TABLE">
  22.  <tr>
  23. <td class="tcp">
  24.  
  25. <br>
  26. The Book Rescue
  27. <br>
  28. Plug in your guesses below!<br>
  29. You have 12 guesses.
  30. <br>&nbsp;<br>
  31.  
  32. <!--THE SCRIPT THAT HE USES-->
  33.  
  34.  
  35. <img src="/gaming/2/word/evapbook/12/hmstart.gif" height="230" width="266" name="hm" alt="Image used to display stages of errors."> 
  36.  
  37. <form name="game">
  38.  
  39. <p><center>
  40. Display Word: <input type="text" name="displayWord"><br>
  41.  
  42. Used Letters: <input type="text" name="usedLetters"> </center></p>
  43. </form>
  44.  
  45.  
  46.  
  47. <p><center>
  48.  
  49. <a href="javascript:selectLetter('A');" onclick="this.style.color='#ff0000'">A</a> |
  50. <a href="javascript:selectLetter('Ä');" onclick="this.style.color='#ff0000'">Ä</a> |
  51. <a href="javascript:selectLetter('B');" onclick="this.style.color='#ff0000'">B</a> | 
  52. <a href="javascript:selectLetter('C');" onclick="this.style.color='#ff0000'">C</a> | 
  53. <a href="javascript:selectLetter('D');" onclick="this.style.color='#ff0000'">D</a> | 
  54. <a href="javascript:selectLetter('E');" onclick="this.style.color='#ff0000'">E</a> | 
  55. <a href="javascript:selectLetter('F');" onclick="this.style.color='#ff0000'">F</a> | 
  56. <a href="javascript:selectLetter('G');" onclick="this.style.color='#ff0000'">G</a> | 
  57. <a href="javascript:selectLetter('H');" onclick="this.style.color='#ff0000'">H</a> | 
  58.  
  59. <a href="javascript:selectLetter('I');" onclick="this.style.color='#ff0000'">I</a> | 
  60. <a href="javascript:selectLetter('J');" onclick="this.style.color='#ff0000'">J</a> | 
  61. <a href="javascript:selectLetter('K');" onclick="this.style.color='#ff0000'">K</a> | 
  62. <a href="javascript:selectLetter('L');" onclick="this.style.color='#ff0000'">L</a>
  63. <a href="javascript:selectLetter('M');" onclick="this.style.color='#ff0000'">M</a>
  64. <a href="javascript:selectLetter('N');" onclick="this.style.color='#ff0000'">N</a> | <br />
  65. <a href="javascript:selectLetter('O');" onclick="this.style.color='#ff0000'">O</a> | 
  66. <a href="javascript:selectLetter('Ö');" onclick="this.style.color='#ff0000'">Ö</a> | 
  67.  
  68. <a href="javascript:selectLetter('P');" onclick="this.style.color='#ff0000'">P</a> | 
  69. <a href="javascript:selectLetter('Q');" onclick="this.style.color='#ff0000'">Q</a> | 
  70. <a href="javascript:selectLetter('R');" onclick="this.style.color='#ff0000'">R</a> | 
  71. <a href="javascript:selectLetter('S');" onclick="this.style.color='#ff0000'">S</a> | 
  72. <a href="javascript:selectLetter('T');" onclick="this.style.color='#ff0000'">T</a> | 
  73. <a href="javascript:selectLetter('U');" onclick="this.style.color='#ff0000'">U</a> | 
  74. <a href="javascript:selectLetter('Ü');" onclick="this.style.color='#ff0000'">Ü</a> |
  75.  
  76. <a href="javascript:selectLetter('V');" onclick="this.style.color='#ff0000'">V</a> | 
  77. <a href="javascript:selectLetter('W');" onclick="this.style.color='#ff0000'">W</a> | 
  78. <a href="javascript:selectLetter('X');" onclick="this.style.color='#ff0000'">X</a> | 
  79. <a href="javascript:selectLetter('Y');" onclick="this.style.color='#ff0000'">Y</a> | 
  80. <a href="javascript:selectLetter('Z');" onclick="this.style.color='#ff0000'">Z</a> </center> </p>
  81.  
  82.  
  83.  
  84. <p> 
  85. <a href="javascript:reset()">Start game / Reset game</a></p>
  86.  
  87. </table>
  88.  
  89. </body>
  90. </html>
Mar 9 '10 #1
3 3129
tpgames
785 Contributor
Oops! Forgot to change title. Code does NOT work period, when I put JS in own file.
Mar 9 '10 #2
tpgames
785 Contributor
Well, code does NOT work even within the same HTML file. I recopied the original, into a new HTML file - EXACTLY! Tested it. Works. Then, I changed the wordlist to be 5 letters long "abcde", "abcde" etc. The code refused to work. I made absolutely certain that the wordlists was made exactly like the 4 letter word list. I double checked to be sure it was "abcde", "abcde") and NOT "abcde, "abcde') or some other error.

ORIGINAL Code (with wordlist edited down considerably)
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <title> Evaporating Book </title>
  5. <META http-equiv="expires" content="Thur, 1 March 2007 13:00:00 GMT">
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  7. <link rel="stylesheet" href="../../../game.css" type="text/css"> 
  8. <link rel="shortcut icon" href="/gwc/img/gwcicon.gif">
  9.  
  10. <script>
  11. //characters can not be longer than 16 letters because browser will not show it.
  12. var can_play = true;
  13. var words = new Array("AAHS", "AALS", "ABAC", "ABAS", "ABBA", "ABBE", "ABBS", "ABED", "ABET", "ABID", "ABLE", "ABLY", "ABOS", "ABRI", "ABUT", "ABYE", "ABYS", "ZYGA", "ZYME");
  14.  
  15.  
  16. var to_guess = "";
  17. var display_word = "";
  18. var used_letters = "";
  19. var wrong_guesses = 0;
  20.  
  21.  
  22. function selectLetter(l)
  23. {
  24. if (can_play == false)
  25. {
  26. return;
  27. }
  28.  
  29. if (used_letters.indexOf(l) != -1)
  30. {
  31. return;
  32. }
  33.  
  34. used_letters += l;
  35. document.game.usedLetters.value = used_letters;
  36.  
  37. if (to_guess.indexOf(l) != -1)
  38. {
  39.  // correct letter guess
  40. pos = 0;
  41. temp_mask = display_word;
  42.  
  43.  
  44. while (to_guess.indexOf(l, pos) != -1)
  45. {
  46. pos = to_guess.indexOf(l, pos);            
  47. end = pos + 1;
  48.  
  49. start_text = temp_mask.substring(0, pos);
  50. end_text = temp_mask.substring(end, temp_mask.length);
  51.  
  52. temp_mask = start_text + l + end_text;
  53. pos = end;
  54. }
  55.  
  56. display_word = temp_mask;
  57. document.game.displayWord.value = display_word;
  58.  
  59. if (display_word.indexOf("?") == -1)
  60. {
  61. // won
  62. alert("You've saved the Book from Evaporation! Congratulations, Mazel Tov and all that good stuff!");
  63. can_play = false;
  64. }
  65. }
  66. else
  67. {
  68. // incorrect letter guess
  69.  
  70. // 10 guesses
  71. wrong_guesses += 1;
  72. eval("document.hm.src=\"hm" + wrong_guesses + ".gif\"");
  73.  
  74. if (wrong_guesses == 10)
  75. {
  76. // lost
  77. alert("Oh no! The Book is evaporating! Please try again!");
  78. can_play = false;
  79. }
  80. }
  81. }
  82.  
  83. function reset()
  84. {
  85. selectWord();
  86. document.game.usedLetters.value = "";
  87. used_letters = "";
  88. wrong_guesses = 0;
  89. document.hm.src="hmstart.gif";  
  90. var links = document.getElementsByTagName("a");   
  91.       for (i = 0; i < links.length; i++) {
  92.           links[i].style.color = "#0000ff";
  93.       } 
  94. }
  95.  
  96.  
  97.  
  98. function selectWord()
  99. {
  100. can_play = true;
  101. random_number = Math.round(Math.random() * (words.length - 1));
  102. to_guess = words[random_number];
  103. //document.game.theWord.value = to_guess;
  104.  
  105. // display masked word
  106. masked_word = createMask(to_guess);
  107. document.game.displayWord.value = masked_word;
  108. display_word = masked_word;
  109. }
  110.  
  111. function createMask(m)
  112. {
  113. mask = "";
  114. word_length = m.length;
  115.  
  116.  
  117. for (i = 0; i < word_length; i ++)
  118. {
  119. mask += "?";
  120. }
  121. return mask;
  122. }
  123. //-- by Chris Fortey @ http://www.c-g-f.net
  124. </script>
  125.  
  126.  
  127.  
  128. </HEAD>
  129.  
  130. <body onLoad="reset(); return true;">
  131.  
  132. <p>
  133. <center><br>
  134.  Evaporating Book
  135. <br>
  136.  
  137. Plug in your guesses below! <br>
  138. You have 10 guesses.
  139. <br>&nbsp;<br></center></p>
  140.  
  141. <!--THE SCRIPT THAT HE USES-->
  142.  
  143. <p> <center> 
  144.  
  145. <img src="hmstart.gif" height="230" width="266" name="hm" alt="Useless Countdown Image in Java Script that won't give alt tags for the other images."> </center> </p>
  146.  
  147. <form name="game">
  148.  
  149. <p><center>
  150. Display Word: <input type="text" name="displayWord"><br>
  151.  
  152. Used Letters: <input type="text" name="usedLetters"> </center></p>
  153. </form>
  154.  
  155.  
  156.  
  157. <p><center>
  158.  
  159. <a href="javascript:selectLetter('A');" onclick="this.style.color='#ff0000'">A</a> | 
  160. <a href="javascript:selectLetter('B');" onclick="this.style.color='#ff0000'">B</a> | 
  161. <a href="javascript:selectLetter('C');" onclick="this.style.color='#ff0000'">C</a> | 
  162. <a href="javascript:selectLetter('D');" onclick="this.style.color='#ff0000'">D</a> | 
  163. <a href="javascript:selectLetter('E');" onclick="this.style.color='#ff0000'">E</a> | 
  164.  
  165. <a href="javascript:selectLetter('F');" onclick="this.style.color='#ff0000'">F</a> | 
  166. <a href="javascript:selectLetter('G');" onclick="this.style.color='#ff0000'">G</a> | 
  167. <a href="javascript:selectLetter('H');" onclick="this.style.color='#ff0000'">H</a> | 
  168.  
  169. <a href="javascript:selectLetter('I');" onclick="this.style.color='#ff0000'">I</a> | 
  170. <a href="javascript:selectLetter('J');" onclick="this.style.color='#ff0000'">J</a> | 
  171. <a href="javascript:selectLetter('K');" onclick="this.style.color='#ff0000'">K</a> | 
  172.  
  173. <a href="javascript:selectLetter('L');" onclick="this.style.color='#ff0000'">L</a>
  174. <a href="javascript:selectLetter('M');" onclick="this.style.color='#ff0000'">M</a><br />
  175. <a href="javascript:selectLetter('N');" onclick="this.style.color='#ff0000'">N</a> | 
  176. <a href="javascript:selectLetter('O');" onclick="this.style.color='#ff0000'">O</a> | 
  177.  
  178. <a href="javascript:selectLetter('P');" onclick="this.style.color='#ff0000'">P</a> | 
  179. <a href="javascript:selectLetter('Q');" onclick="this.style.color='#ff0000'">Q</a> | 
  180. <a href="javascript:selectLetter('R');" onclick="this.style.color='#ff0000'">R</a> | 
  181.  
  182. <a href="javascript:selectLetter('S');" onclick="this.style.color='#ff0000'">S</a> | 
  183. <a href="javascript:selectLetter('T');" onclick="this.style.color='#ff0000'">T</a> | 
  184. <a href="javascript:selectLetter('U');" onclick="this.style.color='#ff0000'">U</a> | 
  185.  
  186. <a href="javascript:selectLetter('V');" onclick="this.style.color='#ff0000'">V</a> | 
  187. <a href="javascript:selectLetter('W');" onclick="this.style.color='#ff0000'">W</a> | 
  188. <a href="javascript:selectLetter('X');" onclick="this.style.color='#ff0000'">X</a> | 
  189.  
  190. <a href="javascript:selectLetter('Y');" onclick="this.style.color='#ff0000'">Y</a> | 
  191. <a href="javascript:selectLetter('Z');" onclick="this.style.color='#ff0000'">Z</a> </center> </p>
  192.  
  193.  
  194.  
  195. <p> 
  196. <center> 
  197.  
  198. <a href="javascript:reset()">Start game / Reset game</a>
  199.  
  200. </center></p>
  201. </script>
  202.  
  203.  
  204. </body>
  205. </html>
  206.  
  207.  
  208.  

MY NEW wordlist
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html lang="utf-8">
  3. <head>
  4. <title> Evaporating Book Words </title>
  5.  
  6. <META http-equiv="expires" content="Thur, 1 March 2007 13:00:00 GMT">
  7. <meta http-equiv="Content-Type" content="text/html charset=utf-8">
  8. <link type="text/css" rel="stylesheet" 
  9. href="http://www.globalwritersclub.com/gaming/2/word/scrambled/css/scrambled.css"> 
  10.  
  11. <script>
  12. //characters can not be longer than 16 letters because browser will not show it.
  13. var can_play = true;
  14. var words = new Array("abcde", "abcde", "abcde", "abcde", "abcde", "abcde", "abcde");
  15.  
  16. var to_guess = "";
  17. var display_word = "";
  18. var used_letters = "";
  19. var wrong_guesses = 0;
  20.  
  21. function selectLetter(l)
  22. {
  23. if (can_play == false)
  24. {
  25. return;
  26. }
  27.  
  28. if (used_letters.indexOf(l) != -1)
  29. {
  30. return;
  31. }
  32.  
  33. used_letters += l;
  34. document.game.usedLetters.value = used_letters;
  35.  
  36. if (to_guess.indexOf(l) != -1)
  37. {
  38.  // correct letter guess
  39. pos = 0;
  40. temp_mask = display_word;
  41.  
  42.  
  43. while (to_guess.indexOf(l, pos) != -1)
  44. {
  45. pos = to_guess.indexOf(l, pos);            
  46. end = pos + 1;
  47.  
  48. start_text = temp_mask.substring(0, pos);
  49. end_text = temp_mask.substring(end, temp_mask.length);
  50.  
  51. temp_mask = start_text + l + end_text;
  52. pos = end;
  53. }
  54.  
  55. display_word = temp_mask;
  56. document.game.displayWord.value = display_word;
  57.  
  58. if (display_word.indexOf("?") == -1)
  59. {
  60. // won
  61. alert("You've saved the Book from Evaporation! Congratulations, Mazel Tov and all that good stuff!");
  62. can_play = false;
  63. }
  64. }
  65. else
  66. {
  67. // incorrect letter guess
  68.  
  69. // 10 guesses
  70. wrong_guesses += 1;
  71. eval("document.hm.src=\"hm" + wrong_guesses + ".gif\"");
  72.  
  73. if (wrong_guesses == 26)
  74. {
  75. // lost
  76. alert("Oh no! The Book is evaporating! Please try again!");
  77. can_play = false;
  78. }
  79. }
  80. }
  81.  
  82. function reset()
  83. {
  84. selectWord();
  85. document.game.usedLetters.value = "";
  86. used_letters = "";
  87. wrong_guesses = 0;
  88. document.hm.src="hmstart.gif";  
  89. var links = document.getElementsByTagName("a");   
  90.       for (i = 0; i < links.length; i++) {
  91.           links[i].style.color = "#0000ff";
  92.       } 
  93. }
  94.  
  95.  
  96.  
  97. function selectWord()
  98. {
  99. can_play = true;
  100. random_number = Math.round(Math.random() * (words.length - 1));
  101. to_guess = words[random_number];
  102. //document.game.theWord.value = to_guess;
  103.  
  104. // display masked word
  105. masked_word = createMask(to_guess);
  106. document.game.displayWord.value = masked_word;
  107. display_word = masked_word;
  108. }
  109.  
  110. function createMask(m)
  111. {
  112. mask = "";
  113. word_length = m.length;
  114.  
  115.  
  116. for (i = 0; i < word_length; i ++)
  117. {
  118. mask += "?";
  119. }
  120. return mask;
  121. }
  122. //-- by Chris Fortey @ http://www.c-g-f.net
  123. </script>
  124.  
  125.  
  126.  
  127. </HEAD>
  128.  
  129. <body onLoad="reset(); return true;">
  130.  
  131. <p>
  132. <center><br>
  133.  Evaporating Book
  134. <br>
  135.  
  136. Plug in your guesses below! <br>
  137. You have 10 guesses.
  138. <br>&nbsp;<br></center></p>
  139.  
  140. <!--THE SCRIPT THAT HE USES-->
  141.  
  142. <p> <center> 
  143.  
  144. <img src="hmstart.gif" height="230" width="266" name="hm" alt="Useless Countdown Image in Java Script that won't give alt tags for the other images."> </center> </p>
  145.  
  146. <form name="game">
  147.  
  148. <p><center>
  149. Display Word: <input type="text" name="displayWord"><br>
  150.  
  151. Used Letters: <input type="text" name="usedLetters"> </center></p>
  152. </form>
  153.  
  154.  
  155.  
  156. <p><center>
  157.  
  158. <a href="javascript:selectLetter('A');" onclick="this.style.color='#ff0000'">A</a> | 
  159.  
  160. <a href="javascript:selectLetter('B');" onclick="this.style.color='#ff0000'">B</a> | 
  161. <a href="javascript:selectLetter('C');" onclick="this.style.color='#ff0000'">C</a> | 
  162. <a href="javascript:selectLetter('D');" onclick="this.style.color='#ff0000'">D</a> | 
  163. <a href="javascript:selectLetter('E');" onclick="this.style.color='#ff0000'">E</a> | 
  164.  
  165. <a href="javascript:selectLetter('F');" onclick="this.style.color='#ff0000'">F</a> | 
  166. <a href="javascript:selectLetter('G');" onclick="this.style.color='#ff0000'">G</a> | 
  167.  
  168. <a href="javascript:selectLetter('H');" onclick="this.style.color='#ff0000'">H</a> | 
  169.  
  170. <a href="javascript:selectLetter('I');" onclick="this.style.color='#ff0000'">I</a> | 
  171. <a href="javascript:selectLetter('J');" onclick="this.style.color='#ff0000'">J</a> | 
  172. <a href="javascript:selectLetter('K');" onclick="this.style.color='#ff0000'">K</a> | 
  173.  
  174. <a href="javascript:selectLetter('L');" onclick="this.style.color='#ff0000'">L</a>
  175. <a href="javascript:selectLetter('M');" onclick="this.style.color='#ff0000'">M</a><br />
  176. <a href="javascript:selectLetter('N');" onclick="this.style.color='#ff0000'">N</a> | 
  177.  
  178. <a href="javascript:selectLetter('O');" onclick="this.style.color='#ff0000'">O</a> | 
  179.  
  180. <a href="javascript:selectLetter('P');" onclick="this.style.color='#ff0000'">P</a> | 
  181. <a href="javascript:selectLetter('Q');" onclick="this.style.color='#ff0000'">Q</a> | 
  182. <a href="javascript:selectLetter('R');" onclick="this.style.color='#ff0000'">R</a> | 
  183.  
  184. <a href="javascript:selectLetter('S');" onclick="this.style.color='#ff0000'">S</a> | 
  185. <a href="javascript:selectLetter('T');" onclick="this.style.color='#ff0000'">T</a> | 
  186.  
  187. <a href="javascript:selectLetter('U');" onclick="this.style.color='#ff0000'">U</a> | 
  188.  
  189. <a href="javascript:selectLetter('V');" onclick="this.style.color='#ff0000'">V</a> | 
  190. <a href="javascript:selectLetter('W');" onclick="this.style.color='#ff0000'">W</a> | 
  191. <a href="javascript:selectLetter('X');" onclick="this.style.color='#ff0000'">X</a> | 
  192.  
  193. <a href="javascript:selectLetter('Y');" onclick="this.style.color='#ff0000'">Y</a> | 
  194. <a href="javascript:selectLetter('Z');" onclick="this.style.color='#ff0000'">Z</a> </center> </p>
  195.  
  196.  
  197.  
  198. <p> 
  199. <center> 
  200.  
  201. <a href="javascript:reset()">Start game / Reset game</a>
  202.  
  203. </center></p>
  204. </script>
  205.  
  206.  
  207. </body>
  208. </html>
  209.  
  210.  
Link to ORIGINAL game

Link to NEW GAME

Thanks! I quit trying to figure this out myself and will patiently wait for help. Signed Stumped!
Mar 9 '10 #3
tpgames
785 Contributor
SOLVED!!! Okay, so I KNOW that the code used CAPS letters unless you change one bit of the code in the HTML file to SMALL case letters. Once, I got the word lists letter to be the same size as the HTML file letters, the code once more worked. LOL

thus the best answer is my own. Get a better editor! lol
Mar 9 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

242
13473
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any comments on past experience, research articles, comments on the matter would be much appreciated. I suspect something like C would be the best based on comments I received from the VB news group. Thanks for the help in advance James Cameron
1
2112
by: djinni | last post by:
It's been a while since I've written anything in C, and I was hoping to get some feedback on the following code. As far as I can tell, the program works fine, but I'm not sure I'm cleaning all the memory up properly, and I think the "tokenize_my_string" function can probably be made better. This program prompts the user for a text sentence, then re-orders the words in a random fashion... ...
13
1862
by: Eric Lilja | last post by:
Hello, consider the following complete program: #include <assert.h> #include <ctype.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <time.h> static int has_char(const char *, const char);
4
1660
by: MN | last post by:
Hello all - I'm really at wits end on this as I'm not having much success with locating a function or other options I have. I'm working on a message board for a website and I'm needing to check the length of the words that users put in. For example, when someone puts in "yesssssssssssss!", I put together a small function that omits all of the s's as this is wreaking havoc on the layout of tables within the site. But I don't have a...
0
2969
by: Lildog | last post by:
I use this code to generate random names for jewelry products I will eventually sell. I found this code on the web and wondered if someone could give a detailed description of each line of code? I want to rewrite it in Revolution and use it as a standalone. Not much code, I think someone who knows perl could blast through it real quick. Thank you much in advance.
7
2748
by: Jay | last post by:
How would I be able to grab random words from an internet source. I'd like to grab a random word from a comprehensive internet dictionary. What would be the best source and the best way to go about this? Thanks. (Sorry if this sounds/is super noobish.)
0
1720
by: raypjr | last post by:
Hi everyone. I need a little help with some parts of a word guessing game I'm working on. I have some parts done but unsure about others and could use a little advice. Any help is very much appreciated.Here is the code to give more detail: Dim GameOver As Boolean Dim NumWords As Integer, ThreeWordList(1000) As String, ThreeWordMeaning(1000) As String Dim R As Integer, WordsLeft(1000) As Integer Dim SecretWord As String,...
5
8062
by: recordlovelife | last post by:
So i have written a code to encode a string of a select amount of letters into huffman code. #include <iostream> #include <string> using namespace std; string Huffman(char letter); string Huffman_word(string word);
2
4039
by: tesa | last post by:
I am not able to figure out how to make this work. I am trying to create a hangman game. I am in a basic javascripting class. I am to only use very basic code as you can see. I am able to use any online resources to help me. I have added alot of comments for what should be happening however is not happening. I also have a teacher that teaches us one way but then asks us to do things he has not taught. I am trying my very best. Any...
7
2692
by: jharrison | last post by:
I'm finding it hard to make this code work in Python 3.0. Been looking at it for some time now: # import module for random functions import random # List of words for the computer to pick from words = ("basketball", "football", "hockey", "rugby", "baseball") # Word to be guessed; picked at random
0
10369
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10372
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10110
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9187
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5682
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.