Results 1 to 3 of 3
  1. #1
    ventrue is offline Member
    Join Date
    Feb 2009
    Posts
    5
    Rep Power
    0

    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.

  2. #2
    paul pasciak is offline Senior Member
    Join Date
    Jul 2008
    Posts
    125
    Rep Power
    0

    Default

    You are right.
    This does sound strange.

    Java 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.

  3. #3
    ventrue is offline Member
    Join Date
    Feb 2009
    Posts
    5
    Rep Power
    0

    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)?

Similar Threads

  1. Game Trees
    By javaBoy1 in forum Advanced Java
    Replies: 0
    Last Post: 12-27-2008, 01:20 AM
  2. 8-Square puzzle loop
    By SapphireSpark in forum New To Java
    Replies: 7
    Last Post: 12-04-2008, 08:21 PM
  3. Help With Tournament Trees
    By wiggsfly in forum New To Java
    Replies: 2
    Last Post: 10-26-2008, 10:38 PM
  4. Java Drawing PUZZLE
    By Cyorxamp in forum AWT / Swing
    Replies: 3
    Last Post: 06-09-2008, 11:35 AM
  5. ElegantJ Trees Bean 1.1
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 07-06-2007, 03:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •