home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Archived / Internet / jvscript116beta / JvScript / !JvScript / Resources / Scripts / Games / 7 < prev   
Encoding:
Text File  |  1999-09-15  |  2.8 KB  |  86 lines

  1. #newformat
  2. _title:Type Tutor
  3. _author:TJS
  4. _contact:
  5. _description:Tests your typing speed and accuracy
  6.  
  7. _insert-in:inhead
  8. <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
  9. <!-- Begin
  10. msg = new Array("Practicing with your typing can greatly help your overall computer skills.",
  11. "A new computer is sold in the US every hour!",
  12. "When do birds migrate from North to South?",
  13. "Perplexing phrases, like this one, are tougher to type.")
  14. word = 10
  15. function m() {
  16. msg = new Array("Practicing with your typing can greatly help your overall computer skills.",
  17. "A new computer is sold in the US every hour!",
  18. "When do birds migrate from North to South?",
  19. "Perplexing phrases, like this one, are tough to type.")
  20. word = 10
  21. }
  22. function e() {
  23. msg = new Array("If you can correctly, and quickly, type this perplexing sentence, you are one superb typist!",
  24. "You are one superb typist if you can correctly, and quickly, type this long phrase.",
  25. "I believe you're a good typist, so I believe you will correctly copy this statement!",
  26. "Because this is not a fairly simple phrase, could you swiftly, and precisely, copy it?")
  27. word = 15
  28. }
  29. function s() {
  30. msg = new Array("Computers are the medium of the future.",
  31. "Can you type this phrase rather quickly?",
  32. "Who is the President of the US?",
  33. "I believe that you can type well!")
  34. word = 7
  35. }
  36. function beginIt() {
  37. randNum = Math.floor((Math.random() * 10)) % 4
  38. msgType = msg[randNum]
  39. day = new Date();
  40. startType = day.getTime();
  41. document.theForm.given.value = msgType
  42. document.theForm.typed.focus();
  43. document.theForm.typed.select();
  44. }
  45. function cheat() {
  46. alert("You can not change that!");
  47. document.theForm.typed.focus();
  48. }
  49. function stopIt() {
  50. dayTwo = new Date();
  51. endType = dayTwo.getTime();
  52. totalTime = ((endType - startType) / 1000)
  53. spd = Math.round((word/totalTime) * 60)
  54. if (document.theForm.typed.value == document.theForm.given.value) {
  55. alert("\nYou typed a " + word + " word sentence in " 
  56. + totalTime + " seconds, a speed of about " + spd + " words per minute!")
  57. }
  58. else {
  59. alert("You made an error, but typed at a speed of " + spd + " words per minute.")
  60.    }
  61. }
  62. // End -->
  63. </SCRIPT>
  64. _end-insert:
  65.  
  66. _insert-in:inbody
  67. <CENTER>
  68. <FORM name="theForm">
  69. <TABLE BORDER=3 CELLSPACING=0 CELLPADDING=0>
  70. <TR>
  71. <TD>Are you a....</TD>
  72. <TD align=center><input type=radio name="sme" value="Beginner" onClick="s()" checked>Beginner
  73. <input type=radio name="sme" value="Novice" onClick="m()">Novice
  74. <input type=radio name="sme" value="Expert" onClick="e()">Expert</TD>
  75. </TR>
  76. <TR><TD colspan=2><BR>
  77. <center><input type=button value="Start Typing Test" name="start" onClick="beginIt()"></center><P>
  78. <textarea name="given" cols=53 rows=3 wrap=on onFocus="cheat()"></textarea></TD>
  79. </TR>
  80. <TR><TD colspan=2><center><input type=text name="typed" size=45>
  81. <input type=button value="DONE"  name="stop"  onClick="stopIt()"></center></TD>
  82. </TR>
  83. </TABLE></FORM>
  84. </CENTER>
  85. _end-insert:
  86.