Hi.
Is there a way to check the contents of the answer for a word? Something like the "contains" block for a list.
So if the user types "walk across the street" as an answer, I have a script that says:
if [answer] contains "walk" or "street" then...
I guess you can see I'm trying to make a text adventure game
Offline
This would be a nice block. "Contains word or phrase" That would be awesome!
Offline
pross67 wrote:
Hi.
Is there a way to check the contents of the answer for a word? Something like the "contains" block for a list.
So if the user types "walk across the street" as an answer, I have a script that says:
if [answer] contains "walk" or "street" then...
I guess you can see I'm trying to make a text adventure game![]()
I made a project with comments...
http://scratch.mit.edu/projects/bhz/565724
Offline
Very nice proof of concept, bhz. Just too many scripts to be useful in even a small text adventure game.
Scratch team, how about a block to check for a string in the answer block? My god, that would be cool.
Last edited by pross67 (2009-06-11 09:29:32)
Offline
pross67 wrote:
Very nice proof of concept, bhz. Just too many scripts to be useful in even a small text adventure game.
Scratch team, how about a block to check for a string in the answer block? My god, that would be cool.
You can always do:
if < letter ( n + 1 ) of ( answer ) = a > and < letter ( n + 2 ) of ( answer ) = l > ...
But I have top agree...that WILL be cool
Offline