I want to create a function that replaces random words in a string. Here is what I thought of.
- Given a string I would give a random index position within that string.
- From that index I will replace the nearest word with a word that I want
- Along with that I would store the word I just replace into some storage variable/database/file
Ex.
Random word seed: tree, cat, wolf, apple
String: The quick brown fox jumps over the lazy dog.
Possible Results:
- The apple brown fox jumps cat the lazy dog.
- The quick brown wolf tree over the lazy dog.
- The quick tree fox tree over the lazy apple.