We help IT Professionals succeed at work.

How to do this G@me

babypink
babypink used Ask the Experts™
on
http://members.sigecom.net/kseifert/WordLadders/solver.htm

First of all, is the above game difficult to do? will it take a lot time?

I intend to do similiar stuff but without the GUI

Thanks









Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2006
Commented:
Download the applet jar file from
http://members.sigecom.net/kseifert/WordLadders/WordLadders.jar
Use a java decompiler like JAD to see the source code of the applet

Author

Commented:
Downloaded JAD, but it only can decomplie .class file?

Commented:
Get the class files out of the jar file... Jar is an archive...

Author

Commented:
How to do it?
Top Expert 2006

Commented:
Use an arcive manager like winzip winrar 7zip
Top Expert 2006

Commented:
Or type in cmd: jar -xf WordLadders.jar
Top Expert 2006

Commented:
Copy the below line in a batch file (i.e. jad.bat) near jad.exe
   jad.exe -sjava -ff -pv4 -noctor -nonlb -space -t -o *.class
Then place all classes which you've extracted from WordLadders.jar, near jad.bat
Now double click on jad.bat

Author

Commented:
Hi hoomanv

manage to do it, thanks

Author

Commented:
can i ask how to convert a word like "dog" to an integer?

Author

Commented:
Example given a string of
re
ti
to
uh
um
un
up
us
ut
we
wo
xi
xu
ya
yo
How to find the shortest path to get from "re" to "yo" changing 1 letter a time ?
so it it "re" -> "we" -> "wo" -> "yo"
Top Expert 2006

Commented:
Perform a BFS (Breadth First Search)
Top Expert 2006

Commented:
> "dog" to an integer
"dog".hashCode()

Author

Commented:
Hi hoomanv ,

how to code for Perform a BFS (Breadth First Search)?
Top Expert 2006

Commented:
You should first learn it. Read the soloutions to problems that are solved by BFS.
Then in this game you start from a root node and expand it to every other leaf node that is reachable from root.
For example "to"
Will lead to "ti" and "wo" and "yo"
And for each new node you have to perform the same strategy until you reach the answer
BFS can be implemented by a Tree or Stack data structure

Author

Commented:
Any similiar code to reference from?
Top Expert 2006

Commented:

Author

Commented:
hard to cant find something similiar to my problem.....
Top Expert 2006

Commented:
You might not found anything similar similar, you should first get the idea behind BFS, and then start coding the game yourself

Author

Commented:
Given
private static List<String> data = new LinkedList<String>();
private static List<String>container = new LinkedList<String>();

How to check if a String in "data" is contain in the "container"

how to code it?

Top Expert 2006

Commented:
Iterate thru all elements of data and check
container.contains(element)

Author

Commented:
I can understand BFS in regard the nodes.....

But how to use it in my problem above?

Can explain in regard my example?
Top Expert 2006

Commented:
And the reason for C grade ?