Hi, my name is garawrules and i'm using Scracth as a school programming software. I'm working on my final project which is an abc for kids. It has 3 different levels, the first one of them consists in pressing the vowel that appears on the screen... Ok, by now all is clear but today my teacher has tried it and she has said that i should make the vowels don't repeat 2 followed times, for example, letter E appears on the screen and the next letter, randomly, is letter E again... I have managed to avoid this but I only have succeeded with A and U (fix variable at random number between 2 and 5 for letter A and between 1 and 4 for letter U). But I don't know how to do it for the others 3 :S
Any help please?
I have to upload the project by wednesday night...
PD: I can't upload it because my teacher will think that is my project finished and will mark me directly... :S
Thanks
Offline
So each vowel is assigned a number (a=1, e=2...), right?
Then make a variable called LastVowel, and set it to the last vowel said (so when A is the last one, set it to 1, etc.)
When you are deciding the next vowel, do this:
There will possibly be a delay when deciding the next vowel, but that will usually last only one or two frames, which will be an imperceptible delay.
Sorry, it's a bit tricky to make this sound clear without seeing your script, I hope you understand.
Last edited by Kileymeister (2011-05-16 16:29:19)
Offline
<repeat( Oh sorry I didn't notice those little squares on the bottom of the page...
My project works this way:
Background programmes:
<when I receive[ play1]
<repeat(10)
<set{ click }to(0)
<set{luck }to(<pick random(1 )to( 5)
<broadcast[ play2]
<wait until><( <{correct }> <=>1 )>
<set{ correct }to( 0
<end>
Vowel programmes (eg: letter a)
<when I receive[ play2]
<if><< <( <{luck }> <=>1 )> <and><( <{correct }> <=> 0 )> >>
<set{click }to( 1
<go to x 0 )y 0
<show>
<repeat until><key[a ]pressed?>
<end>
<hide>
<set{correct }to( 1
<end>
Hope you understand
Offline
Ok, make a variable called LastVowel and make these changes (pointed out by the comments):
Background Script:
Vowel Script:
Last edited by Kileymeister (2011-05-16 18:35:25)
Offline
It works!! Thank you so much
Offline
I would also like to add the suggestion of the <wait until> block which can shrink the size of the code so: <wait until < key [ a ] pressed? > > might be useful in the future.
Last edited by Magnie (2011-05-17 14:15:23)
Offline