Please support our Pascal and Delphi advertiser: Programming Forums
Views: 3587 | Replies: 15
![]() |
•
•
Join Date: Dec 2006
Location: Romania
Posts: 171
Reputation:
Rep Power: 2
Solved Threads: 16
Re: Pascal : Access a file of 100 Quiz questions so 12 Random ones are displayed?
#11
Apr 23rd, 2007
from i what i saw in your code you read from the file with questions and print the question on screen. now, why you don't read the entire file, built that array of records, apply the randomize and then put a question from that array?
e.g: ado is that array of records.
randomize;
cycle
put_question: ado[random(i)+a_value]
end_of_cycle
i hope you understand the principle.
best regards,
e.g: ado is that array of records.
randomize;
cycle
put_question: ado[random(i)+a_value]
end_of_cycle
i hope you understand the principle.
best regards,
Re: Pascal : Access a file of 100 Quiz questions so 12 Random ones are displayed?
#12
Apr 23rd, 2007
•
•
Join Date: Dec 2006
Location: Romania
Posts: 171
Reputation:
Rep Power: 2
Solved Threads: 16
Re: Pascal : Access a file of 100 Quiz questions so 12 Random ones are displayed?
#13
Apr 23rd, 2007
ok, i'm sorry for my mistake, i only tried to explain it in a pseudocode manner.
so,
e.g: ado is that array of records.
randomize;
cycle//this can be a while, repeat,ect. you must think until when this cycle is going.
put_question: ado[random(i)+a_value]
end_of_cycle
hope that now is more obvious
best regards,
so,
e.g: ado is that array of records.
randomize;
cycle//this can be a while, repeat,ect. you must think until when this cycle is going.
put_question: ado[random(i)+a_value]
end_of_cycle
hope that now is more obvious
best regards,
Re: Pascal : Access a file of 100 Quiz questions so 12 Random ones are displayed?
#14
Apr 23rd, 2007
•
•
Join Date: Dec 2006
Location: Romania
Posts: 171
Reputation:
Rep Power: 2
Solved Threads: 16
Re: Pascal : Access a file of 100 Quiz questions so 12 Random ones are displayed?
#15
Apr 24th, 2007
•
•
•
•
Yep thats great, I totally get it and I thank you again for your help!
this is the scope of a forum, to help between us. now i will ask you then when the program is finished to post it here so when a begginer will search the same thing to find it and learn from it
best regards,
Re: Pascal : Access a file of 100 Quiz questions so 12 Random ones are displayed?
#16
Apr 24th, 2007
Sure but its not going to be done for a while cos I have a big exam to study for and as I stated at the start my program already meets the project requirements so I'll just hand it in without the random function.
Although I plan to do the random feature after my exam (end of May) and when it is done I will happily post it up here.
Although I plan to do the random feature after my exam (end of May) and when it is done I will happily post it up here.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)





Linear Mode