+ 2
How can I make my code choose from random words to produce an answer or output?
2 ответов
+ 22
As @Mattias suggested, you should use external file/db for large collection of words. For small collection, here are some sample codes of generators in C++:
Credits: Pixie, Hatsy Rei, Maz, StillSoul
https://code.sololearn.com/cMArmlhta6l4/?ref=app
https://code.sololearn.com/cCAyuTHiI4tx/?ref=app
https://code.sololearn.com/cVVneCFi0q5d/?ref=app
https://code.sololearn.com/cSY5Ob4m8isM/?ref=app
+ 1
Well, you need a source to get the words from, a file or a database.
Then generate a random number and use the word att that position.