May-19-2017, 07:21 AM Hey guys so I need to write a Random Sentance Generator that reads nouns. adjectives, adverbs, conjunctions, Intransitive verbs, Leadin, Nounmarkes, Transitive verbs From files that contain these parameters then produces random but structurally correct English sentences, according to the syntax (rules of grammar). I have the contents of these files made up in txt files ready to go yet I am just confused as to how to read all of them and put this into the code. I have written an example program to test random just with some different variables Also at some point I will need to include the following commands available using a menu and prompt for a command. CMD Effect L Load all the files of words from disk. T Test – display the first word from each list to make sure they've been loaded. E Easy sentence: display a two word sentence - a randomly selected noun followed by a randomly selected intransitive verb and then a full stop. S new Sentence - generate & display a sentence If the wordlists haven't been loaded, display an error message. Q Quit the program. May-19-2017, 10:59 PM (May-19-2017, 07:21 AM)Liquid_Ocelot Wrote: I have the contents of these files made up in txt files ready to go yet I am just confused as to how to read all of them and put this into the code. If the file has one word per line, you would want something like this: Craig 'Ichabod' O'Brien - xenomind.com I wish you happiness. Recommended Tutorials: BBCode, functions, classes, text adventures |
Ready to sell screen prints, Screen print transfers, cute screen print transfers, cheap screen print transfers, rts screen print transfers, heat transfers, fast shipping, in stock screen print transfers, screen print transfer temperature settings, screen prints, unique screen print transfers, butter soft screen prints. 'The Simpsons' Homer's Enemy (TV Episode 1997) Hank Azaria as Moe Szyslak, Chief Wiggum, Carl Carlson, Frank Grimes, Clerk, Auctioneer.
Your Homie Hacks A Sloth
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Random quiz generator | Truman | 16 | 8,180 | Jun-01-2018, 05:23 AM Last Post: wavic |
Users browsing this thread: 1 Guest(s)