I would like to write a "Random" adventure book, with a little user input.
I will have to pass data to functions, which is not a biggie. I would like the program to loop for continued reading. I will have the user input new data for the next story. Not sure how I want to word the output, to get input yet.
I'm just asking for some ideas with approaching this, not how to write it.
I will however need some guidance with checking the random number. I don't want the same story to be replayed if the user chooses to use the program again.
(I would like to add more stories, but for now I will stick to 5.)
I would say store your stories on separate text files or in a different file under a namespace such as Writtendata::story1(). This could help to separate the coding aspect and the writing aspect and improve organization.
for the loop, you would want to start out with something simple like
1 2 3 4 5 6 7 8
bool running = truewhile(running)
{
//code here
//user is done, changes running to false
}
std::cout << thanks for playing!
for your random numbers, create a new integer each loop and assign it a random number, then switch that random number. If you wish for the stories not to repeat themselves, you could assign each story a Boolean value that is checked to false after being selected to take it out of the possible pool of choices.