Re: BGT question
Something like this (replace the questions and answers as you wish):
void main() {
int size=3; // Or however many questions you want.
string[] questions(size);
string[] answers(size);
questions[0] = "Say hello.";
answers[0] = "hello";
questions[1] = "What color is the sky?";
answers[1] = "blue";
questions[2] = "How many licks does it take to get to the Tootsy Roll center of a Tootsy Pop?";
answers[2] = "3 if you're an owl";
// now, pick one:
int index = random(0, size-1);
string text = input_box(questions[index], "Your answer:");
// Just to be safe, let's make sure the answer and input are the same case:
text = string_to_lower_case(text);
if(text == answers[index]) {
alert("Correct!", "You gave the correct response!");
}
else {
alert("Incorrect!", "That is not the right answer!");
}
}
_______________________________________________ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector