| Author |
Randomize a set of words
|
Jennifer Sohl
Ranch Hand
Joined: Feb 28, 2001
Posts: 455
|
|
Hi. Not sure if this is the right place to post this. We are trying to create a table that has a ton of four letter words in it(minus the nasty ones ). Right now we have the list of words in an Excel spreadsheet in alphabetical order. We want to scramble these so when we use them to be assigned as order codes, they don't get assigned alphabetically. My question is, how do I do this? Can anyone supply me with some java code to get this done, or at least give me a couple of hints where to look? Thanks in advance!!
|
 |
Michael Matola
whippersnapper
Ranch Hand
Joined: Mar 25, 2001
Posts: 1722
|
|
|
Take a look at Collections.shuffle() to see it can help you out.
|
 |
Carl Trusiak
Sheriff
Joined: Jun 13, 2000
Posts: 3340
|
|
You can try something like this This will return the String[] in a completely random order. [ April 08, 2002: Message edited by: Carl Trusiak ]
|
I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
|
 |
Jennifer Sohl
Ranch Hand
Joined: Feb 28, 2001
Posts: 455
|
|
Thanks guys!!
|
 |
 |
|
|
subject: Randomize a set of words
|
|
|