KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have an string array filled with words from a sentence. words[0] = "the" words[1] = "dog" words[2] = "jumped" words[3] = "over" words[4] = "the" words[5] = "wall." words[6] = "the" words[7] = "cat" words[8] = "fell" words[9] = "off" words[10] = "the" words[10] = "house." etc. (Stupid example, but it works for this) Each word will be a key with it's following word as it's value. so "over" => "the". Some keys can have multiple values. For example, "the" => "dog" || "wall" || "cat" || "house". The value is randomly chosen from those for that key. When the program runs it picks a word at random and makes a sentence. So it could be something like: "the cat fell off the dog". I tried implementing a map (map myMap;) but this allows only one value per key (I think). Hope I explained this right.
Tags (comma-separated)
Save Edits
Cancel