Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-23-2009, 11:14 PM
Member
 
Join Date: Feb 2009
Posts: 5
Rep Power: 0
ventrue is on a distinguished road
Default Need help with Trees...(8-puzzle)
I have an assignment that needs to be done in a little more than 2 weeks, and it is based on understanding of the Trees implementation in Java. I am to create an 8-puzzle game, where it is possible to push a button and solve the puzzle. I have been reading much about the trees structure and function, but I do not get the standard idea of how to create a tree at all. Is there a blueprint a beginner can follow to make a simple tree with for example 3 nodes? It would be of great help if anyone could pinpoint me of on how to create a small tree, just to start with.
Just for the record, I have been notified by my teacher that the correct method of doing this would be adding nodes as I am searching through the tree for the solution. Is this correct? What I don't get is how my code can search through something that not yet is created... so I get confused

Any help is greatly appreciated. Thanks in advance.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 03-23-2009, 11:50 PM
Member
 
Join Date: Jul 2008
Posts: 64
Rep Power: 0
paul pasciak is on a distinguished road
Default
You are right.
This does sound strange.

Code:
 Just for the record, I have been notified by my teacher that the
 correct method of doing this would be adding nodes as I am searching
 through the tree for the solution. Is this correct? What I don't get is how my
 code can search through something that not yet is created... so I get confused
You might be getting the rules for the "8-puzzle"
mixed up with how nodes in a tree actually work.

Seperate the two, then you might be able
to submit a clearer request.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 03-24-2009, 12:04 AM
Member
 
Join Date: Feb 2009
Posts: 5
Rep Power: 0
ventrue is on a distinguished road
Default
I wrote a few unnecessary lines I guess. Let's put it like this: how do I start with creating a tree with for example only 3 nodes (one of them is root)?
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Game Trees javaBoy1 Advanced Java 0 12-27-2008 01:20 AM
8-Square puzzle loop SapphireSpark New To Java 7 12-04-2008 08:21 PM
Help With Tournament Trees wiggsfly New To Java 2 10-26-2008 10:38 PM
Java Drawing PUZZLE Cyorxamp AWT / Swing 3 06-09-2008 11:35 AM
ElegantJ Trees Bean 1.1 JavaBean Java Announcements 0 07-06-2007 03:59 PM


All times are GMT +2. The time now is 03:00 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org