Results 1 to 11 of 11
  1. #1
    vuzuggu is offline Member
    Join Date
    Oct 2011
    Posts
    19
    Rep Power
    0

    Default Animal Vegetable Mineral Game

    I have to complete a college assignment where we create a JAVA game based on the Animal Vegetable Mineral Game. The user thinks of an object and the program tries to guess it. I'm fine with the coding of it, I just can't get my head around how to design the game. We have to use binary trees. So what I am thinking for every true answer it goes left node and every false answer it goes to the right node. Then at the bottom of the stem (not sure if that is correct terminology!) is the answer.

    If the guess is wrong the user is asked what they were thinking and what differentiates the guess from the object and then this question is added to the binary tree. In this way it gains 'artificial intelligence'

    We have to save the binary tree to disk and then open it up every time a new user uses the program. What I am struggling to get my head around is how to save the questions and answers in such a way that the program knows which one is to be asked next. If anyone has any ideas I would really appreciate it. Even subtle hints would be appreciated.

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,798
    Rep Power
    7

    Default Re: Animal Vegetable Mineral Game

    You could use Serialization.

  3. #3
    vuzuggu is offline Member
    Join Date
    Oct 2011
    Posts
    19
    Rep Power
    0

    Default Re: Animal Vegetable Mineral Game

    Thanks for that. I'll have a look into the serialization now. Just so you know what standard I'm at I only took up Java in September and do 2 lecture a week so the more basic the better!

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,587
    Rep Power
    25

    Default Re: Animal Vegetable Mineral Game

    That looks like an advanced project for a beginning programmer. What programming and logic background is required for this course you are taking?

  5. #5
    vuzuggu is offline Member
    Join Date
    Oct 2011
    Posts
    19
    Rep Power
    0

    Default Re: Animal Vegetable Mineral Game

    Yup, They love throwing us in the deep end! I do computing which is basically coding for ARM processors and then I also do JAVA programming. So far Ive done simple programs, counting palindromes, reading sums from a file and calculating, saving numbers to a binary tree so this is a massive jump.

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,587
    Rep Power
    25

    Default Re: Animal Vegetable Mineral Game

    To me the design work on this program is hugh. There must be some simplifying assumptions you can make to make the assignment more reasonable.

  7. #7
    vuzuggu is offline Member
    Join Date
    Oct 2011
    Posts
    19
    Rep Power
    0

    Default Re: Animal Vegetable Mineral Game

    Our outline was:

    Your assignment is to research, design & implement an AVM system that exhibits the following properties:

    That provides a clean and simple console based interface.
    That is not limited to a fixed set of categories (eg. animal, mineral, vegtable, sport, book, ...)
    Can store new knowledge from execution to execution.
    That can obtain and store refinements following incorrect guesses, so that these object can be correctyl guessed in future.
    that can list the set of possible things the program is presently considering if the user responds:
    +++ does it have fur?
    list
    +++ I think it might be a monkey, a bird, or a cow.
    +++ does it have fur?

    That presented with the name of an object, can print out the questions the program would ask, and indicate how many questions would be necessary.
    That is designed as a set of classes.

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,587
    Rep Power
    25

    Default Re: Animal Vegetable Mineral Game

    Most of the work for this program will be the design. Once you have that, the programming will probably very straight forward.

  9. #9
    vuzuggu is offline Member
    Join Date
    Oct 2011
    Posts
    19
    Rep Power
    0

    Default Re: Animal Vegetable Mineral Game

    Yup, been bugging me for days. I know I'd be able to code it but it's just the planning that I can't do. I suppose I'll need to work these things out in the future too so will be good practise. Any hints would be brilliant though!

  10. #10
    vuzuggu is offline Member
    Join Date
    Oct 2011
    Posts
    19
    Rep Power
    0

    Default Re: Animal Vegetable Mineral Game

    Still struggling to get to grips on how to save the binary tree to file. Would any one have any suggestions as to how I could go about saving the tree?
    Thanks in advance.

  11. #11
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,587
    Rep Power
    25

    Default Re: Animal Vegetable Mineral Game

    An idea:
    Assign an id to each node in the tree derived from the paths taken to get to that node: Left-Left-Right
    The path could be encoded to fit in a int or just use the first letters: LLR
    Then write a file with the IDs and contents for each node

Similar Threads

  1. Replies: 1
    Last Post: 06-02-2011, 10:29 AM
  2. Replies: 2
    Last Post: 08-05-2010, 05:49 AM
  3. game code for any game
    By deathnote202 in forum Java Gaming
    Replies: 4
    Last Post: 06-10-2010, 09:06 AM
  4. 2D strategy game or 2D war game
    By led1433 in forum Java 2D
    Replies: 5
    Last Post: 02-10-2009, 07:00 AM
  5. Animal Shelter Manager 2.0.22
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 07-01-2007, 10:11 AM

Posting Permissions

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