number_game.html 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <html>
  2. <head>
  3. <title>Speed Numbers</title>
  4. <LINK REL="SHORTCUT ICON" HREF="../../ting.ico">
  5. <STYLE type="text/css">
  6. <!--
  7. A { text-decoration:none; color:white; }
  8. A:visited { text-decoration:none; color:white; }
  9. body {margin: 0 0 0 0;}
  10. -->
  11. </STYLE>
  12. <style>
  13. #datainfo { position: relative; top: 0; left:0; height:14px; width:100%;}
  14. #timeinfo { position: relative; top: 0; left:0; width:100%;}
  15. </style>
  16. <script language="javascript">
  17. <!--
  18. var agt=navigator.userAgent.toLowerCase();
  19. var is_major = parseInt(navigator.appVersion);
  20. var is_nav = ((agt.indexOf("mozilla")!=-1) && (agt.indexOf("spoofer")==-1) && (agt.indexOf("compatible") == -1) && (agt.indexOf("opera")==-1) && (agt.indexOf("webtv")==-1));
  21. var is_nav5up = (is_nav && (is_major >= 5));
  22. var is_ie = (agt.indexOf("msie") != -1);
  23. var max = 10;
  24. var min = 0;
  25. var num = "";
  26. var counter = 0;
  27. function showNumber(){
  28. if (counter <=9){
  29. counter++;
  30. if (counter == 1){
  31. document.myform1.next.value = "Next>>";
  32. writeInfo('timeinfo', '');
  33. h = 0;
  34. s = 0;
  35. m = 0;
  36. timeID = setInterval("tellTime()",1000);
  37. }
  38. eval("num = '<center><h2>" + (Math.round(Math.random()*(max-min))+min) + "</h2></center>'");
  39. writeInfo('datainfo', num);
  40. if (counter == 10){
  41. document.myform1.next.value = "End";
  42. }
  43. }
  44. else{
  45. if (counter == 10){
  46. clearInterval(timeID);
  47. counter = 100;
  48. if (confirm("Good Job! " + hinfo + minfo + sinfo + "\nPlay again?")){
  49. document.myform1.next.value = "Start";
  50. counter = 0;
  51. }
  52. }
  53. else{
  54. if (confirm("Play again?")){
  55. document.myform1.next.value = "Start";
  56. counter = 0;
  57. }
  58. }
  59. }
  60. }
  61. function changeRange(xMin, xMax){
  62. min = xMin;
  63. max = xMax;
  64. }
  65. function writeInfo(layN, info){
  66. if ((!is_nav5up) && is_nav ){
  67. eval("with (document.layers['" + layN + "'].document){ write(info); close();}");
  68. }
  69. if (is_nav5up){
  70. eval("document.getElementById('" + layN + "').innerHTML= info;");
  71. }
  72. if (is_ie){
  73. eval("document.all['" + layN + "'].innerHTML = info;");
  74. }
  75. }
  76. //-->
  77. </script>
  78. <style>
  79. #root {position:relative; width:100%; top: 2px; left:0;}
  80. #subroot {position: absolute; left: 30%;}
  81. #descr {position: absolute; left:0; top:0;}
  82. </style>
  83. </head>
  84. <body marginwidth="0" marginheight="0">
  85. <body onResize="window.location.href = window.location.href;">
  86. <DIV ID="descr">&nbsp;</DIV>
  87. <table CELLPADDING="0" CELLSPACING="0" BORDER="0" border="0" bgcolor="#330099" height="8">
  88. <tr>
  89. <td NOWRAP="1" VALIGN=CENTER bgcolor="#330099">&nbsp;&nbsp;<font face="Verdana,Arial,Helvetica" size="1"><a href="../../welcome.html">Home </a></font>&nbsp;&nbsp;<font size+1><font color="#FFFFFF">|</font></font></td>
  90. <td NOWRAP="1" bgcolor="#330099">&nbsp;&nbsp;<font face="Verdana,Arial,Helvetica" size="1"><a href="http://hua.umf.maine.edu/China/china.html">China Index</a></font>&nbsp;&nbsp;<font size+1><font color="#FFFFFF">|</font></font></td>
  91. <td NOWRAP="1" bgcolor="#330099">&nbsp;&nbsp;<font face="Verdana,Arial,Helvetica" size="1"><a href="../../topics/number2/douying.html">Topics: Numbers </a></font>&nbsp;&nbsp;<font size+1><font color="#FFFFFF">|</font></font></td>
  92. <td NOWRAP="1" bgcolor="#330099">&nbsp;&nbsp;<font face="Verdana,Arial,Helvetica" size="1"><a
  93. href="../games.html">Games</a></font>&nbsp;&nbsp;<font size+1><font color="#FFFFFF">|</font></font></td>
  94. <td NOWRAP="1" bgcolor="#330099">&nbsp;&nbsp;<font face="Verdana,Arial,Helvetica" size="1" color="#CCCC00">Number Game</font>&nbsp;&nbsp;<font size+1></font></td>
  95. </tr>
  96. </table>
  97. &nbsp;
  98. <center><table BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR="#FFFFFF" >
  99. <tr>
  100. <td><img SRC="numbergameframe8pieces_01.gif" height=46 width=51></td>
  101. <td><img SRC="numbergameframe8pieces_02.gif" BORDER=0 height=46 width=344></td>
  102. <td><img SRC="numbergameframe8pieces_03.gif" height=46 width=55></td>
  103. </tr>
  104. <tr>
  105. <td><img SRC="numbergameframe8pieces_04.gif" height=355 width=51></td>
  106. <td VALIGN=TOP>
  107. <center>
  108. <font color="#339933"><h1><i>Speed Numbers</i></h1></font>
  109. <form name="myform">
  110. <input type="radio" name="range" onclick="changeRange(0, 10); return true;" checked>0 - 10<br>
  111. <input type="radio" name="range" onclick="changeRange(0, 100); return true;">0 - 100<br>
  112. <input type="radio" name="range" onclick="changeRange(0, 1000); return true;">0 - 1000<br>
  113. <input type="radio" name="range" onclick="changeRange(0, 10000); return true;">0 - 10000<br>
  114. <input type="radio" name="range" onclick="changeRange(0, 100000); return true;">0 - 100000</form>
  115. <script language="javascript">
  116. <!--
  117. if ((!is_nav5up) && is_nav )
  118. document.write("<br><br><br><br><layer id='datainfo'>&nbsp;</layer>");
  119. else
  120. document.write("<div id='datainfo'><h2>&nbsp;</h2></div>");
  121. //-->
  122. </script><br>
  123. <form name="myform1">
  124. <input type="button" name="next" value="&nbsp;&nbsp;start&nbsp;&nbsp;" onclick="showNumber()">
  125. </form>
  126. </center>
  127. <script language="javascript">
  128. <!--
  129. if ((!is_nav5up) && is_nav ){
  130. document.write("<br><layer id='timeinfo'>&nbsp;</layer>");
  131. }
  132. else{
  133. document.write("<div id='timeinfo'>&nbsp;</div>");
  134. }
  135. var h=0;
  136. var hinfo = "";
  137. var m=0;
  138. var minfo = "";
  139. var s=0;
  140. var sinfo = "";
  141. var t;
  142. function tellTime(){
  143. s++;
  144. if (s>=60){
  145. s = 0;
  146. m++;
  147. }
  148. else{
  149. if (s<=1)
  150. eval("sinfo = '" + s + " second'");
  151. else
  152. eval("sinfo = '" + s + " seconds'");
  153. }
  154. if (m>=60){
  155. m = 0;
  156. h++;
  157. }
  158. else{
  159. if (m<=1)
  160. eval("minfo = '" + m + " minute '");
  161. else
  162. eval("minfo = '" + m + " minutes '");
  163. }
  164. if (h<=1)
  165. eval("hinfo = '" + h + " hour '");
  166. else
  167. eval("hinfo = '" + h + " hours '");
  168. if ((!is_nav5up) && is_nav )
  169. t = "<center>" + hinfo + minfo + sinfo + "</center>";
  170. else
  171. t = "<center>" + hinfo + minfo + sinfo + "</center>";
  172. writeInfo("timeinfo", t);
  173. }
  174. //-->
  175. </script>
  176. </td>
  177. <td><img SRC="numbergameframe8pieces_06.gif" height=355 width=55></td>
  178. </tr>
  179. <tr>
  180. <td><img SRC="numbergameframe8pieces_07.gif" height=49 width=51></td>
  181. <td><img SRC="numbergameframe8pieces_08.gif" height=49 width=344></td>
  182. <td><img SRC="numbergameframe8pieces_09.gif" height=49 width=55></td>
  183. </tr>
  184. </table></center>
  185. </body>
  186. </html>