Author Topic: Speed Typing Test 2  (Read 6048 times)

0 Members and 1 Guest are viewing this topic.

This topic contains a post which is marked as Best Answer. Press here if you would like to see it.

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Speed Typing Test 2
« on: September 26, 2019, 12:10:41 am »
This is nothing like the one I posted a few days ago, so I made it a new thread. I hope some of you try this one. This one knows your every keystroke as you take the one minute test. You only type one word at a time and it stops at 60 seconds (not like the old one where it was a bad rough guess). I put enough words for the 216 word world record but it also skips to the next word if you type any key incorrectly. If you go past the 216 words, it starts them over again. It also doesn't display your score as you go because I didn't want any distraction as you did this. It will display your results after the 1 minute is over. It's kinda funny how the hardest part of programming this was the simple INKEY$ in that even though it had a tiny loop for it, it still would keep going for some reason, so I switched the variables and now it works fine. lol Please tell me what you think of it, I do appreciate your comments. Thank you.

Code: QB64: [Select]
  1. _TITLE "Speed Typing Test 2"
  2. begin:
  3. t = 0
  4. PRINT "                           Speed Typing Test 2"
  5. PRINT "                               By Ken G."
  6. PRINT "This program will calculate how many words you can type in 1 minute"
  7. PRINT "It will display 1 word at a time and you must type it correctly to count."
  8. PRINT "If you press a wrong key, it will just go to the next word and that word"
  9. PRINT "will not count on your total. It will also not show a score as you go because"
  10. PRINT "I don't want to distract your thinking as you type. Your score will be shown"
  11. PRINT "at the end of the 1 minute test."
  12. PRINT "There are 216 words (which is the world record), but if you have mistakes"
  13. PRINT "and skip words (or if you are a world record holder), then the words will start"
  14. PRINT "over again."
  15. PRINT "This is not a professional typing test, only just for fun."
  16. INPUT "Press Enter to start.", st$
  17. tim1 = INT(TIMER)
  18. again:
  19. tt = 0
  20. b$ = ""
  21. READ a$
  22. a$ = LTRIM$(a$)
  23. a$ = RTRIM$(a$)
  24. IF a$ = "z" THEN
  25.     RESTORE words:
  26.     GOTO again:
  27. LOCATE 10, 30
  28. n = LEN(a$)
  29. LOCATE 14, 30
  30. go:
  31. _LIMIT 100
  32. DO UNTIL b$ <> ""
  33.     b$ = INKEY$
  34.     tim2 = INT(TIMER)
  35.     tim3 = tim2 - tim1
  36.     IF tim3 = 60 THEN GOTO done:
  37. c$ = b$
  38. b$ = ""
  39. tt = tt + 1
  40. PRINT c$;
  41. IF c$ <> MID$(a$, tt, 1) THEN GOTO again:
  42. IF tt = n THEN t = t + 1: GOTO again:
  43. c$ = ""
  44. GOTO go:
  45. done:
  46. PRINT "Your score is: "; t; " correct words per minute."
  47. INPUT "Again (Y/N)"; ag$
  48. IF LEFT$(ag$, 1) = "y" OR LEFT$(ag$, 1) = "Y" THEN RESTORE words: GOTO begin:
  49.  
  50. words:
  51. DATA "apple","strong","universe","mountain","doorway","oxygen","airplane","computer","glasses","nitrogen","water","hydrogen","colors","ray-gun"
  52. DATA "fifty","percent","Jupiter","Saturn","quartz","calcite","pine","carpet","duties","taxes","silver","electrolysis","experiment","calculator"
  53. DATA "jetliner","programming","instant","valve","arteries","translucent","graphics","perplexing","meteorite","energy","musician","wonderful"
  54. DATA "insight","gravitational","mind","loving","selfless","journey","expand","foreigner","watch","book","camera","words","pictures","sounds"
  55. DATA "calendar","decades","years","months","weeks","days","hours","minutes","seconds","milliseconds","microseconds","nanoseconds","picoseconds"
  56. DATA "script","movie","theater","television","technology","railroad","caboose","entertaining","magazine","painting","artist","brush","acrylic"
  57. DATA "watercolor","pastel","paper","drawing","pencil","digital","pixels","photography","film","album","frame","vision","eyesight","memories"
  58. DATA "enjoyment","ink","forms","essays","university","experience","supersonic","lunar","orbit","Venus","Mercury","Pluto","galaxy","nebula"
  59. DATA "cluster","stars","telescope","observatory","rings","light","spaceship","satellite","sci/fi","science","multiplication","division"
  60. DATA "exponents","power","percentage","athlete","walkway","miles","bicycle","freedom","peaceful","feeling","air","warm","cold","clouds"
  61. DATA "sky","suntan","pressure","temperature","degrees","raining","snowing","bright","fog","brisk","night","morning","noon","afternoon"
  62. DATA "energetic","late","early","telephone","Internet","website","homepage","chores","vacuuming","dusting","dishes","rest","lunch","dinner"
  63. DATA "breakfast","reading","driving","store","groceries","meat","vegetables","fruit","bread","ice cream","cake","cookies","dessert","milk"
  64. DATA "cereal","yogurt","frozen","snacks","banana","pie","chocolate","grapes","potatoes","lettuce","salad","carrots","asparagus","mayonnaise"
  65. DATA "cream","sugar","salt","pepper","shakers","cups","silverware","table","napkins","chairs","dining","restaurant","turkey","gravey","family"
  66. DATA "If","you","type","this","then","might","hold","the","record","for","typing","z"
  67.  

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Speed Typing Test 2
« Reply #1 on: September 26, 2019, 10:37:09 am »
Hi Ken,

Wait the world record is 216 words? not characters? Well how does one determine how long a word should be for a typing speed test? (rhetorical) Do the words have symbols and punctuation because as a coder you discover the little fact that symbols and punctuation and numbers... slow one down fast enough! ;-))

I tried your other typing test and learned I can't type 10 letters going for speed without my fingers getting tied up in knots. LOL funny thing about me, I am never eager to learn my faults.

I am glad you discovered INKEY$ and you might look into ON TIMER for starting and stopping a test at exactly 1 minute, and since we are all coders here, just grab snatches of code to use for testing speed typing, maybe go for how many lines of code you can type, design the game for your audience.
« Last Edit: September 26, 2019, 10:39:16 am by bplus »

Offline Jack002

  • Forum Regular
  • Posts: 123
  • Boss, l wanna talk about arrays
    • View Profile
Re: Speed Typing Test 2
« Reply #2 on: September 26, 2019, 11:09:43 am »
How many characters to a word? 5. :-)

5

https://www.keyhero.com/news6/
QB64 is the best!

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Speed Typing Test 2
« Reply #3 on: September 26, 2019, 12:39:20 pm »
Only 5? Wow. Well, I'm guessing the average amount of all my words are probably around 6. I'm going to change it with only 5 letter words, I found a neat list just now online.

LOL B+, yeah I wasn't really thinking about coding super fast, but that could be a challenge sometime lol.
« Last Edit: September 26, 2019, 12:43:05 pm by SierraKen »

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: Speed Typing Test 2
« Reply #4 on: September 26, 2019, 12:41:33 pm »
Wait the world record is 216 words? not characters?

probably, as back in college i was able to hit up in the 400 characters per min, i think the best I got in words per min was around 120-130.
but the method used then was to have a passage or paragraph of some text to copy. so words varied from 1 letter, 'A's and 'I's, to longer words like topographical' and such("a map of the topographical type were of a far superior form than others.") .  Your speed was also based on how many words you got wrong to, that value adjusted your over all word-per-min speed. I had a bad habit of trying to fix as I went which always detracted from my over all speed. I believe my best speed ever was typing numeric values(just numbers) where I got 560-590(I think, it was 20 years ago) characters per min once. Oh to be young again, and not have mauled your fingers on a table saw....

My first run on this I managed a whooping 18! although I kept hitting enter at the end of each word which skipped the next word which flashed just long enough I would hit the first letter or two skipping the next word or two and really threw me all out of wack! I might make it so the space bar goes to the next word, just like normal typing; finish the word, hit space, next word. also should track the number of incorrect words.

This is a neat and fun program though, Good job Ken.

With my eyes as old as they are I might need to zoom the font up a little too.
Granted after becoming radioactive I only have a half-life!

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Speed Typing Test 2
« Reply #5 on: September 26, 2019, 12:48:05 pm »
Wow thanks Cobalt! I will make the font larger on mine. The space bar is logical to people that are used to it a lot. But it does reduce the speed by a fraction so I think I will re-word a little bit on the welcome screen on how it works better.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Speed Typing Test 2
« Reply #6 on: September 26, 2019, 03:05:58 pm »
Fine SierraKen
At start I have not understood that just I type the wrong character the program pass to the next word and that I cannot change my input... but program is fine and runs good...

here a my different version of speed_type made sometimes ago
to take a look please
1.  download this 

2. if you want type in english you must rename words.txt to words_ita.txt and again words_En.txt to words.txt

3. load in QB64 and compile it
Good Luck


Programming isn't difficult, only it's  consuming time and coffee

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Speed Typing Test 2
« Reply #7 on: September 26, 2019, 03:37:19 pm »
LOL that's great Tempodi! I like how you made a game out of it. Mine is more of the same kind of program professionals use. I know this because I took one back in the early 90's. Of course I won't call mine professional because I am not a professional myself, so mine is just for fun.

I am almost done putting the new words on mine, which are all 5 letter words. They are also all in alphabetical order only because the website I'm using for the words are that way and there's no reason to change it. The website has a lot more words so I have to pick and choose.

Marked as best answer by SierraKen on September 27, 2019, 10:09:24 am

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Speed Typing Test 2
« Reply #8 on: September 26, 2019, 06:01:07 pm »
Here is the updated version. I did everything I wanted to do except make the font size larger. I tried changing it to _FONT 17 but for some reason it make my window twice the size in width and I didn't want that.
The score I got was 32 words per minute. Probably because I never took a typing class. :)
Every word is 5 letters long now to make it fair and even.  There are exactly 9 words for each letter of the alphabet, which makes 234.
I also decided to make the words randomly used so every time you use this program, the words will be arranged differently. Was tough but I figured it out. :)

Here it is:

Code: QB64: [Select]
  1. 'This program was made on Sept. 25th and 26th of 2019 by Ken G.
  2. 'Thank you to the QB64.org forum for their support and comments.
  3.  
  4. _TITLE "Speed Typing Test 2"
  5. SCREEN _NEWIMAGE(800, 600, 32)
  6. COLOR _RGB32(255, 255, 255)
  7. begin:
  8. t = 0
  9. e = 0
  10. w = 0
  11. COLOR _RGB32(255, 0, 0)
  12. PRINT "                                Speed Typing Test 2"
  13. COLOR _RGB32(255, 255, 255)
  14. PRINT "                                    By Ken G."
  15. PRINT "     - This program will calculate how many words you can type in 1 minute."
  16. PRINT "     - It will display 1 word at a time and you must type it correctly to count."
  17. COLOR _RGB32(255, 0, 0)
  18. PRINT "     - If you press a wrong key, it will just go to the next word and that word"
  19. PRINT "       will not count on your total."
  20. PRINT "     - Do not press Enter, Back Space, or Space Bar because it will go to the next"
  21. PRINT "       word automatically."
  22. COLOR _RGB32(255, 255, 255)
  23. PRINT "     - It will not show a score as you go because I don't want to distract"
  24. PRINT "       your thinking as you type."
  25. PRINT "     - Your score will be shown at the end of the test."
  26. PRINT "     - There are 234 5-letter words (which is more than the world record), but if you have"
  27. PRINT "       mistakes and skip words (or if you are a world record holder), then the words"
  28. PRINT "       will start over again after the very last word."
  29. PRINT "     - The words are shown in a different arrangement every time."
  30. PRINT "     - This is not a professional typing test, so have some fun!"
  31. INPUT "                            Press Enter to start.", st$
  32.  
  33. 'Start the timer.
  34. tim1 = INT(TIMER)
  35.  
  36. begin2:
  37.  
  38. 'Put every word in memory.
  39. DIM a$(300), olda$(300)
  40. FOR l = 1 TO 234
  41.     READ a$(l)
  42.  
  43. check:
  44. 'See if every word has been used.
  45. w = w + 1
  46. IF w = 235 THEN
  47.     w = 0
  48.     FOR cc = 1 TO 234
  49.         olda$(cc) = ""
  50.     NEXT cc
  51.     RESTORE words:
  52.     GOTO begin2:
  53.  
  54. 'Pick a random word and check to see if it's already been used.
  55. ll = INT(RND * 234)
  56. FOR ch = 1 TO 234
  57.     IF a$(ll) = olda$(ch) THEN GOTO check:
  58. NEXT ch
  59. olda$(ll) = a$(ll)
  60. tt = 0
  61. b$ = ""
  62.  
  63. 'Display word.
  64. LOCATE 5, 35
  65. PRINT a$(ll)
  66.  
  67. 'Here is the INKEY$ loop and also checking your time.
  68. LOCATE 8, 35
  69. go:
  70. _LIMIT 100
  71. DO UNTIL b$ <> ""
  72.     b$ = INKEY$
  73.     tim2 = INT(TIMER)
  74.     tim3 = tim2 - tim1
  75.     IF tim3 = 60 THEN GOTO done:
  76. c$ = b$
  77. b$ = ""
  78.  
  79. 'Check to see if you got the letter correct. tt is the amount of letters you have typed.
  80. tt = tt + 1
  81. PRINT c$;
  82. IF c$ <> MID$(a$(ll), tt, 1) THEN e = e + 1: GOTO check:
  83. IF tt = 5 THEN t = t + 1: GOTO check:
  84. c$ = ""
  85.  
  86. 'Go back to go: to keep typing.
  87. GOTO go:
  88.  
  89. 'This is your total score area.
  90. done:
  91. PRINT "               Your score is: "; t; " correct words per minute."
  92. PRINT "               You had: "; e; " errors."
  93. INPUT "               Again (Y/N)"; ag$
  94. IF LEFT$(ag$, 1) = "y" OR LEFT$(ag$, 1) = "Y" THEN RESTORE words: GOTO begin:
  95.  
  96. 'All 234 words that can be used.
  97. words:
  98. DATA "aahed","aalii","aargh","abaca","abaci","aback","abaft","abaka","abamp"
  99. DATA "blurt","blush","blype","board","boars","boart","boast","boats","bobby"
  100. DATA "cawed","cease","cebid","cecal","cecum","cedar","ceded","ceder","cedes"
  101. DATA "doxie","doyen","doyly","dozed","dozen","dozer","dozes","drabs","draff"
  102. DATA "ebook","eched","eches","echos","eclat","ecrus","edema","edged","edger"
  103. DATA "fixes","fixit","fizzy","fjeld","fjord","flabs","flack","flags","flail"
  104. DATA "given","giver","gives","gizmo","glace","glade","glads","glady","glair"
  105. DATA "herby","herds","heres","herls","herma","herms","herns","heron","heros"
  106. DATA "intro","inure","inurn","invar","iodic","iodid","iodin","ionic","iotas"
  107. DATA "juicy","jujus","juked","jukes","jukus","julep","jumbo","jumps","jumpy"
  108. DATA "kitty","kivas","kiwis","klick","kliks","klong","kloof","kluge","klutz"
  109. DATA "leaps","leapt","learn","lears","leary","lease","leash","least","leave"
  110. DATA "maybe","mayed","mayor","mayos","mayst","mazed","mazer","mazes","mbira"
  111. DATA "nexus","ngwee","nicad","nicer","niche","nicks","nicol","nidal","nided"
  112. DATA "oaths","oaves","obeah","obeli","obese","obeys","obias","obits","objet"
  113. DATA "payor","peace","peach","peage","peags","peaks","peaky","peals","peans"
  114. DATA "quack","quads","quaff","quags","quail","quais","quake","quaky","quale"
  115. DATA "rewin","rewon","rexes","rheas","rheme","rheum","rhino","rhomb","rhumb"
  116. DATA "saids","saiga","sails","sains","saint","saith","sajou","saker","sakes"
  117. DATA "techs","techy","tecta","teddy","teels","teems","teens","teeny","teeth"
  118. DATA "udons","uglis","uhlan","ukase","ulama","ulans","ulcer","ulema","ulnad"
  119. DATA "vowed","vowel","vower","voxel","vroom","vrouw","vrows","vuggs","vuggy"
  120. DATA "wavey","wawls","waxed","waxen","waxer","waxes","wazoo","weald","weals"
  121. DATA "xenon","xeric","xerox","xerus","xylan","xylem","xylol","xylyl","xysti"
  122. DATA "yodle","yogas","yogee","yoghs","yogic","yogin","yogis","yoked","yokel"
  123. DATA "zooey","zooid","zooks","zooms","zoons","zooty","zoril","zoris","zouks"
  124.  
« Last Edit: September 26, 2019, 06:44:48 pm by SierraKen »

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Speed Typing Test 2
« Reply #9 on: September 27, 2019, 12:22:51 pm »
I found 1 wrong GOTO statement going to a place where I didn't want it to go. It still worked but it didn't go to all 234 words if someone made it that far. Here is the fix:

(Deleted because I was wrong.)
« Last Edit: September 27, 2019, 12:33:15 pm by SierraKen »

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Speed Typing Test 2
« Reply #10 on: September 27, 2019, 12:32:15 pm »
(Deleted because I decided to keep the version above instead and it has information already on the post about it.)
« Last Edit: September 27, 2019, 02:10:37 pm by SierraKen »

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Speed Typing Test 2
« Reply #11 on: September 27, 2019, 02:33:54 pm »
Hi SierraKen

yes I can appreciate the random words to type, the count of the exact words and of the wrong words... but thinking to those that uses glasses... what do you think to use a larger character (FONT) or to calculate a difficult with different score related to different dimension of character more big less score...
thanks to share !
Programming isn't difficult, only it's  consuming time and coffee

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Speed Typing Test 2
« Reply #12 on: September 27, 2019, 03:06:55 pm »
Yeah someone mentioned the font earlier and I tried changing it, but any bigger font just made the window much larger, which I do not want. I don't know how to make a large font and still keep a 800 x 600 size window. Does anyone know? Thanks.

As for the score, I really don't know how I can make it more fair. Professional typing tests do it this way usually because 1 extra key slows everything down so you my as well just go to the next word and keep typing. You do have to get used to this though, it might take a few times to get the hang of it.

Offline OldMoses

  • Seasoned Forum Regular
  • Posts: 469
    • View Profile
Re: Speed Typing Test 2
« Reply #13 on: October 03, 2019, 08:14:43 am »
This is a pretty good benchmark IMO. I managed about 16 wpm, which is down somewhat from the 20 or so that I though I was at. It was a first run and I wasn't really ready for the way the program worked. I tend to hit space by default which made it skip the next word, then that got me a bit flustered and things went downhill from there. All in all, pretty cool.

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Speed Typing Test 2
« Reply #14 on: October 03, 2019, 12:25:10 pm »
Thanks OldMoses, yeah you have to use it a couple times in order to get used to it. But I'm glad you like it.