473,382 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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

tpgames
785 512MB
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 3097
tpgames
785 512MB
Oops! Forgot to change title. Code does NOT work period, when I put JS in own file.
Mar 9 '10 #2
tpgames
785 512MB
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 512MB
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
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...
1
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...
13
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...
4
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...
0
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...
7
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...
0
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...
5
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);...
2
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...
7
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.