Forums Register Login

randomize sentances

+Pie Number of slices to send: Send
I don't have code yet. I have a question. I want to write several sentences. I then want to randomize those sentences so that my program will spit out a sentence at random. I am thinking arrays would do this? Just not sure and need a little input to point me in the right direction.
+Pie Number of slices to send: Send
Yeah, you could probably have arrays (or Lists) of nouns, verbs, adjectives (one array/List of each), and pick items from them at random, then use those items to fill out a template of Subject-noun verb adjective object-noun.

HTH
Simon
+Pie Number of slices to send: Send
If you have pre-made sentences, you can dump them all in a List, and then shuffle the list.
+Pie Number of slices to send: Send
I just figured that out. Thanks. I am going to put my sentences in an array then shuffle the array. I appreciate the help.
1
+Pie Number of slices to send: Send
Probably much easier to shuffle a List because you can use this.
You’ll find me in my office. I’ll probably be drinking. And reading this tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 471 times.
Similar Threads
Creating a Score List and High Score list?
help with a program
simple encryption/decryption program
how to print in capital of each frist word
Creating a random math sign
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 04:10:45.