Computer Science Canada

trivia game

Author:  Prince [ Wed Apr 23, 2003 10:21 am ]
Post subject:  trivia game

im thinkin of creatin a trivia type game [a la jeopardy or you don't know jack (if u havnt played it, its a pretty fun game)]... does anyone kno of a way that i can make it so that certain questions go with certain answers?

Author:  Tony [ Wed Apr 23, 2003 11:15 am ]
Post subject: 

arrays and files I'd say...

1D array of

1..NofQuestions

to store the questions

2D array of

1..NofQuestion, 1..5 (assuming 4 multiple choice anwers)

for each question, 4 possible anwers. 5th slot is for the correct anwers.

Once chosen, you do something like

if answers(guess) = answers(5) then
put "you're correct"

since you know that 5th always holds the correct answer.


: