P
philbo30
Caveat: I know very little about C; please exuse my current ignorance.
Here's what I need to do:
I have a list of 10 quotations that I want to display, at random each
time my DOS application is run. Currently, I have them commented out,
since I don't know how to get them working. Here's an example of how
they look right now (just 2 for reference):
/*Trivia Question 1
printf("Today's Trivia\n");
printf("Did you know that the\n");
printf("Sears Tower is over 500\n");
printf("meters tall and contains 108\n");
printf("floors?\n");
*/
/*Trivia Question 2
printf("Today's Trivia\n");
printf("Did you know that the\n");
printf("Fordham Spire is over 600\n");
printf("meters tall and contains 124\n");
printf("floors?\n");
*/
Because I have limited output space to work with, I need them to
display in the manner shown above. (i.e. no more than 4 to 5 words per
line).
I assume the basic process is something to the effect of:
1. Associate each of the 10 trivia questions with an integer
2. Upon running the .exe, generate a random integer from the list and
then
3. Display the trivia question associated with the random integer
4. Do again
It really boils down to # 3, displaying each trivia question,
consisting of 5 to 7 lines, as a unit, at random, each time application
runs.
In advance, thank you for any information you may be able to provide or
any direction you may be able to point me in. Please note that this
will be running on an embedded system, so the most simple approach, as
usual, is the best, I think.
Philbo
Here's what I need to do:
I have a list of 10 quotations that I want to display, at random each
time my DOS application is run. Currently, I have them commented out,
since I don't know how to get them working. Here's an example of how
they look right now (just 2 for reference):
/*Trivia Question 1
printf("Today's Trivia\n");
printf("Did you know that the\n");
printf("Sears Tower is over 500\n");
printf("meters tall and contains 108\n");
printf("floors?\n");
*/
/*Trivia Question 2
printf("Today's Trivia\n");
printf("Did you know that the\n");
printf("Fordham Spire is over 600\n");
printf("meters tall and contains 124\n");
printf("floors?\n");
*/
Because I have limited output space to work with, I need them to
display in the manner shown above. (i.e. no more than 4 to 5 words per
line).
I assume the basic process is something to the effect of:
1. Associate each of the 10 trivia questions with an integer
2. Upon running the .exe, generate a random integer from the list and
then
3. Display the trivia question associated with the random integer
4. Do again
It really boils down to # 3, displaying each trivia question,
consisting of 5 to 7 lines, as a unit, at random, each time application
runs.
In advance, thank you for any information you may be able to provide or
any direction you may be able to point me in. Please note that this
will be running on an embedded system, so the most simple approach, as
usual, is the best, I think.
Philbo