English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am making a game which consists of 5 problems(1+1=?, 5 x 6=?) and 3 choices(a.3 b.78 c.80) but I dont know how to randomize the questions and choices...pls help

2007-01-19 14:18:50 · 1 answers · asked by greg 2 in Computers & Internet Software

1 answers

You have to place the questions and answers in arrays.

Dim questions(10) as string
Dim answers(10) as string

questions(1) = "1+1"
answers(1) ="2"

questions(2) = "3x7"
answers(2) ="21"

Next you need to use a procedure:

Public PickQuestion()

x=int(10*rnd(1)): if x<1 then x=1

Label1.caption=questions(x)

For the command button when it is clicked the procedure code would be:

if text1.txt = answers(x) then msgbox("correct")

2007-01-19 14:28:35 · answer #1 · answered by Shawn H 6 · 0 0

fedest.com, questions and answers