hey! i'm trying to make a typing test program on snap! and i got everything to work, but i don't know how to make the user's input case sensitive. for example, when the user has to type "The cat runs with the dog," the T in the beginning should be capitalized, but I don't know how to report an error message if the user types a lower-case letter. what should I do?
The IS IDENTICAL TO block is case sensitive:
It should report false if the T is not capitalized.
edit: here's a much much better way
that doesn't work... you're comparing T to "The cat runs with the dog" which will always report false. What you should do is,
"T" is identical to (letter (1) of "The cat runs with the dog)?
Presumably the variable holds the entire text the user typed, not just the T.
lol, didn't realize that.
But if you did it that way, you can't tell what mistakes the user made. Instead, check each letter one at a time.
I guess. But the user can, once it's pointed out that they made some. Either way...
thanks for the suggestions! i'll try them out
(You don't need the constant block, just use )
Have you been following Jens on facebook because below is very similar custom "key name pressed?" block which Jens shared on March 18:
The difference between yours and Jens's is that his one uses an 'up-var' while your block uses a script-var.
I don't use facebook. Also, I saw a script like mine in the forum a while ago (idk who made it)
I like both, yours and Jens' solutions, and how you are putting to use the recent hyperization of the 'key _ pressed' block.
I didn't know it used hyperblocks... it didn't look like it... but I turned hypblocks off, and it just threw an error...
I thought the block hasn't been able to sense all the (multiple) keys being pressed at the same time, but in this post by snapenilk (that he posted before the block was hyperized), it seems it did just that.
oh wait, I just realized why it didn't work with hyperblocks, I was using hyperblocks for the unicode of block. If I made that not use hyperblocks, it would work.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.