I'm making this project where if there's a certain word in your answer to a question in one of those sensing
ask []ask blocks, then it's added to a list. I'm trying lots of things, but it won't work! Help will be greatly appreciated!
Offline
I'm not entirely sure what you mean, but I think what you need is a script that adds your answer to a list only if it is a certain answer. Is this right?
Offline
That's the idea. The only thing is what I'm thinking is if there's certain words within your answer, than it adds it to a list, for example:
When gf Clicked Forever If (Answer) contains "run" // but your answer could be something like "JimBob likes to run." Add [run] to [thing v] endThanks!
Offline
Well, try this:
set [adder v] to [] //Blank. set [loopcounter v] to [1] ask [YourQuestion] and wait repeat (length of (answer)) if <(letter (loopcounter) of (answer)) = [ ]> //A space. add (adder) to [words v] set [adder v] to [] //Blank. else set [adder v] to (join (adder) (letter (loopcounter) of (answer))) end change [loopcounter v] by (1) end if <[words v] contains [YourWord]> add (answer) to [YourList v] end
Last edited by SciTecCf (2012-05-28 14:36:16)
Offline
SciTecCf wrote:
Well, try this:
set [adder v] to [] //Blank. set [loopcounter v] to [1] ask [YourQuestion] and wait repeat (length of (answer)) if <(letter (loopcounter) of (answer)) = [ ]> //A space. add (adder) to [words v] set [adder v] to [] //Blank. else set [adder v] to (join (adder) (letter (loopcounter) of (answer))) end change [loopcounter v] by (1) end if <[words v] contains [YourWord]> add (answer) to [YourList v] end
I tried that - it didn't work. I surrounded it with a forever block and then inside of it a "if" block, and finally inside those scripts. The if I put was accurate - did I do something wrong? Thanks!
Last edited by powerpoint56 (2012-05-28 14:45:51)
Offline
powerpoint56 wrote:
SciTecCf wrote:
Well, try this:
set [adder v] to [] //Blank. set [loopcounter v] to [1] ask [YourQuestion] and wait repeat (length of (answer)) if <(letter (loopcounter) of (answer)) = [ ]> //A space. add (adder) to [words v] set [adder v] to [] //Blank. else set [adder v] to (join (adder) (letter (loopcounter) of (answer))) end change [loopcounter v] by (1) end if <[words v] contains [YourWord]> add (answer) to [YourList v] end
I tried that - it didn't work. I surrounded it with a forever block and then inside of it a "if" block, and finally inside those scripts. The if I put was accurate - did I do something wrong? Thanks!
Ah, yes. It doesn't work.
Here is a version of it that does:
delete (all v) of [words] set [adder v] to [] //Blank. set [loopcounter v] to [1] ask [YourQuestion] and wait repeat (length of (answer)) if <(letter (loopcounter) of (answer)) = [ ]> //A space. add (adder) to [words v] set [adder v] to [] //Blank. else set [adder v] to (join (adder) (letter (loopcounter) of (answer))) end change [loopcounter v] by (1) end add (adder) to [words v] set [adder v] to [] //Blank. if <[words v] contains [YourWord]> add (answer) to [YourList v] end
Offline
SciTecCf wrote:
powerpoint56 wrote:
SciTecCf wrote:
Well, try this:
set [adder v] to [] //Blank. set [loopcounter v] to [1] ask [YourQuestion] and wait repeat (length of (answer)) if <(letter (loopcounter) of (answer)) = [ ]> //A space. add (adder) to [words v] set [adder v] to [] //Blank. else set [adder v] to (join (adder) (letter (loopcounter) of (answer))) end change [loopcounter v] by (1) end if <[words v] contains [YourWord]> add (answer) to [YourList v] end
I tried that - it didn't work. I surrounded it with a forever block and then inside of it a "if" block, and finally inside those scripts. The if I put was accurate - did I do something
wrong? Thanks!Thanks! I'm about to try it out!
that turned out funny!
Ah, yes. It doesn't work.
Here is a version of it that does:delete (all v) of [words] set [adder v] to [] //Blank. set [loopcounter v] to [1] ask [YourQuestion] and wait repeat (length of (answer)) if <(letter (loopcounter) of (answer)) = [ ]> //A space. add (adder) to [words v] set [adder v] to [] //Blank. else set [adder v] to (join (adder) (letter (loopcounter) of (answer))) end change [loopcounter v] by (1) end add (adder) to [words v] set [adder v] to [] //Blank. if <[words v] contains [YourWord]> add (answer) to [YourList v] end
Last edited by powerpoint56 (2012-05-28 15:06:06)
Offline
THANK YOU SO MUCH!!!! I spent so long trying, and finally the idea came to me, how 'bout I just post I need help?
THANK YOU AGAIN!
Offline
Did it work?
Offline