2
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by Comatose
0

I don't understand what you are wanting to do.... do you want each word of the sentence in a new label, or do you want a random word of the sentence in the one label???

0

I'm Pretty Sure This Is What You Are Asking For. The Key To Understand How This Works, Is To Take A Good Hard Look At The Collection. A Collection, Which Is Like An Array, Has Methods That Makes Working With Data Easier. We Populate The Collection With All The Words Of The Sentence, And Then Loop Through All The Words We Have, Generating A Random Number Between Zero And The Same Length As The Collection. Then, We Remove The Element Of The Collection That Was Randomly Selected (After Assigning It To An Array), Which Will Make The Max Variable (The Variable Used As The Upper Border Of The Random Seed) Decrement, Making The Random Selection One Less Than Before (Not Just One Less, But The One We Have Already Randomly Chosen On The Previous Loop).

I'm Probably Complicating The Situation By Trying To Explain It So In Depth, So Examine The Code And Comments, And Let Me Know How It Works Out For You.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.