Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 trivia game
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Prince




PostPosted: 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?
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed Apr 23, 2003 11:15 am   Post subject: (No 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: