i try to create a multiple choice question game but i'm in trouble!
i can make it to appear a question when the spite touches another spite, for example (when ... touches.... - ask ...- if -answer = a - say You won). So,my problem is that when someone is going to play the game again i can make it to have many different questions...
I believe that it has something to do with " random choice 1 to 10"
but i can find an appropriate codec
if you have any idea plz let me know
Offline
jaksta wrote:
hi i am new i am mwhitey12 friend
Hi jaksta! If you're new, why not post it in the "New Members" forum?
As for your problem, I'm not quite sure what you're getting at. To sum up:
-You have a project which asks a question when a sprite touches another sprite.
-You want mostly different questions when the user restarts the project.
Am I correct?
Last edited by coolstuff (2010-05-19 17:05:07)
Offline
yeap coolstuff you are right!
Offline
Maybe this code will do the trick. First, make a list will all of your questions in it.
When green flag clicked
forever
if <touching [sprite] >
ask (item (pick random 1 to (length of [list] ) ) of [list]
wait until <not <touching sprite> >
===================
======
Last edited by coolstuff (2010-05-19 18:43:35)
Offline
i think that's a quiete cool codec but then i'm going to have problems with the right answer... i found that someone used 3 lists to do something like what i want, one questions,one answers and one called order... i will to try something with that and i'll see...
Offline
fatamorgAnna wrote:
i think that's a quiete cool codec but then i'm going to have problems with the right answer... i found that someone used 3 lists to do something like what i want, one questions,one answers and one called order... i will to try something with that and i'll see...
You'll only need two lists - the order list is compensated for by the order of the two lists.
Make a list with all of your questions in it, and then make another list with all of your answers in it. Make sure that the lists correspond, for example, item 1 of the Answers list is the answer to item 1 of the Questions list. Make a variable, call it what you want. For this example, we'll call it "Variable." Then use this script instead:
When Green Flag Clicked forever if <touching [sprite]> set [variable] to (pick random (1) to (length of [Questions])) ask (item (variable) of [Questions]) and wait if <(answer) = (item (variable) of [Answers]) [Insert code for right answer] else [Insert code for wrong answer] end end end
Offline