Results 1 to 9 of 9
Thread: "Jumble" or "Scramble" Program
- 04-28-2008, 04:32 AM #1
Member
- Join Date
- Apr 2008
- Posts
- 5
- Rep Power
- 0
"Jumble" or "Scramble" Program
Can someone please post code on how to scramble words (Like a game that you would play in the newspaper). I just cant seem to figure out how to scramble the words.
This is what my code looks like now:
public class Jumble
{
public static void main(String[] args)
{
String[] wordList = // can be any length
{"MAGIC", "SCORE", "FUNNY", "HELLO", "PROJECT", "VACATION",
"WINNER", "HAPPY", "TARGET", "DELHI", "COMPUTER", "JAVA",
"CLASS", "SMART", "SUMMER", "LATER", "FRIEND", "HIDDEN",
"BOGUS", "FANCY", "HORSE", "TRAIN", "LOVE", "BABY", "WORK",
"PROGRAM", "EASY", "STUDY", "MONEY", "STREET", "LUNCH"};
String theWord;
theWord = wordList[(int) (Math.random() * wordList.length) + 1];
System.out.println(theWord);
}
}
Thank you for any help
- 04-28-2008, 07:51 AM #2
- 04-28-2008, 07:53 AM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Shadow22202 use the same thread you have already started. Please don't start separate threads.
- 04-28-2008, 08:04 AM #4
Ha didn't even look to see if it was the same person lol
My IP address is 127.0.0.1
- 04-28-2008, 08:16 AM #5
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Yes, if he doesn't have response quickly to this, I have to moderate this thread.
- 04-28-2008, 02:54 PM #6
Member
- Join Date
- Apr 2008
- Posts
- 5
- Rep Power
- 0
Sorry wont happen again
- 04-29-2008, 03:50 AM #7
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 04-29-2008, 06:20 PM #8
Member
- Join Date
- Apr 2008
- Posts
- 5
- Rep Power
- 0
Ya i solved it, thank you
- 04-30-2008, 03:42 AM #9
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Ok, please mark the thread solved. It's really helpful to others. :) If you don't know how to do it, read this page. ;)
Similar Threads
-
Hwlp with "Open", "Save", "Save as..."
By trill in forum New To JavaReplies: 3Last Post: 11-02-2010, 09:26 AM -
failure at Class.forName("oracle.jdbc.driver.OracleDriver");
By RonNYC in forum EclipseReplies: 1Last Post: 03-14-2008, 02:51 PM -
Exception in thread "main" java.net.ConnectException: Connection timed out
By osval in forum Advanced JavaReplies: 1Last Post: 07-27-2007, 10:59 PM -
Error: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
By romina in forum New To JavaReplies: 1Last Post: 07-25-2007, 10:55 PM -
ArrayList: Exception in thread "main" java.lang.NullPointerException
By susan in forum New To JavaReplies: 1Last Post: 07-16-2007, 06:32 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks