Discuss Scratch

AboveAverageCoder
Scratcher
28 posts

How would I make a WPM counter for my typing game?

I need a variable or number that changes depending on how fast you type: Link to game https://scratch-mit-edu.ezproxyberklee.flo.org/projects/1135256258/
hi_bobux725
Scratcher
100+ posts

How would I make a WPM counter for my typing game?

words per minute/WPM formula:

(round ((60) / (how fast you typed a word)))

pneumonoultramicroscopicsilicovolcanoconiosis: took 7 seconds to type so my WPM is 8
Elaver_3000
Scratcher
57 posts

How would I make a WPM counter for my typing game?

hi_bobux725 wrote:

words per minute/WPM formula:

(round ((60) / (how fast you typed a word)))

pneumonoultramicroscopicsilicovolcanoconiosis: took 7 seconds to type so my WPM is 8
This could be improved on, since it took me a very negligible amount of time to write the word “a”, which means I have a words per minute of undefined.
You should already have an implemented “words typed variable”, so you can:
set [wpm v] to ((wordstyped) / ((timer) / (60))) // Total words typed divided by the internal timer divided by 60 to get the total minutes elapsed.
AboveAverageCoder
Scratcher
28 posts

How would I make a WPM counter for my typing game?

hi_bobux725 wrote:

words per minute/WPM formula:

(round ((60) / (how fast you typed a word)))

pneumonoultramicroscopicsilicovolcanoconiosis: took 7 seconds to type so my WPM is 8

How come I divide by 60?
AboveAverageCoder
Scratcher
28 posts

How would I make a WPM counter for my typing game?

Elaver_3000 wrote:

hi_bobux725 wrote:

words per minute/WPM formula:

(round ((60) / (how fast you typed a word)))

pneumonoultramicroscopicsilicovolcanoconiosis: took 7 seconds to type so my WPM is 8
This could be improved on, since it took me a very negligible amount of time to write the word “a”, which means I have a words per minute of undefined.
You should already have an implemented “words typed variable”, so you can:
set [wpm v] to ((wordstyped) / ((timer) / (60))) // Total words typed divided by the internal timer divided by 60 to get the total minutes elapsed.

Usually, a word counts as 4 - 5 letters so I thought I would divide by 4. But I have not yet implemented this in my game so it looks like this:

if <(word counter) > [4]> then
set [WPM v] to (((word counter) / (timer)) * (30))
set [word counter v] to ((word counter) mod (5))
reset timer
end

Powered by DjangoBB