Ok, so as an assignment I have been asked to create a random poem generator.
I have been provided with the format for the poem to take so thats not an issue, what I need to work out, is how to select random words or phrases from a text/data file.
I have been considering having the lists of words/phrases in a text file, seperated by carriage returns. I then generate a random number and count this many carriage returns into the file, then take the next string after that. I would need to limit the range of the random numbers to the length of the list presumably. But yea basically I'm just posting to see what people think of this approach? Will it be efficient? Is there another approach I should consider? Will this be easily achievable in C++? I think it should be, I just need to brush up on my file handling.
Thank you for any input.