Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / The table (game of questions of general culture)

Author
Message
Beginner forum
20
Years of Service
User Offline
Joined: 31st Jan 2004
Location:
Posted: 20th Feb 2004 15:22
I am beginner. I started to create a game of questions of general culture. I made a table.
Dim question$ (4)
…
Dim answer$(4)
…
For the moment a question has only one answer. But I block on the questions which can have several answers. For example:
Who was the Pharaon husband of Néfertiti?
Two answers are possible Akhenaton or Aménophis IV.
How to make the table?
Thank you


lolo
GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 20th Feb 2004 16:18
I'm not sure on what you are asking... but i think you could make several answers to each question by Declaring the array like this...

Dim Answer$(4,4)

Then each question could have up to five answers... so you could say...

Question$(0)="Who was the Pharaon husband of Néfertiti?"
Answer$(0,0)="Akhenaton"
Answer$(0,1)="Aménophis IV"

well... I hope that answers your question...

Do not thwart the way of the dragon. For thou tasteth like chicken.
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 20th Feb 2004 18:16 Edited at: 20th Feb 2004 18:16
It might be better to go with a multiple choice set of questions since computers are very literal about string characters and the slightest thing will cause it not to match the correct answer.

If you're using DBP, you can make an array of types:

type questionFormat
question as string
answer1 as string
answer2 as string
answer3 as string
answer4 as string
answer as integer
end type

dim test(20) as questionFormat

... add code to open a text file or read data statements
--
TAZ

Login to post a reply

Server time is: 2024-11-26 05:33:13
Your offset time is: 2024-11-26 05:33:13