• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tile Game

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how can i use ID-DFS algorithm for a tile game.?
puzzle.jpg
[Thumbnail for puzzle.jpg]
 
Alina Gilbard
Greenhorn
Posts: 3
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
help........
 
Ranch Hand
Posts: 287
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm just curious - if you can't be bothered doing your coursework then please explain why you think anyone else will feel inclined to do it for you?
 
Alina Gilbard
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I didn't ask you to do my cw mr Mich Robinson ,what i wanted to know is an idea .....how to do this ,
if i want you to do my cw i'm not asking help . ill copy a code in the net and submit it.
i wanted to take and idea ...........

BUT THANXXXXXX A LOT FOR YOUR HELP
 
Mich Robinson
Ranch Hand
Posts: 287
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Alina Gilbard wrote:what i wanted to know is an idea


I assume you've done recursion and tree traversing - then the aim is to just try all the moves within a certain depth and see if you get a solution. If you do then the solution with the shortest depth is the best. If you don't then increase the depth. You'll need routines to try each move, a routine to check to see if the solution has been found, and something to remove the previous move.

Reading through the question I can't see why you're asked to store each move in a file - seems a bit pointless to me. I also couldn't see why you store the value "2/4" in the middle of the board state. I also couldn't see why you need to store everything in memory at the same time as surely you just store the current path through the tree rather than the whole tree. If you're doing it in Java then it would be nice to print the board position at each point so you can see the game being solved.

Does that give you any ideas?
 
Mich Robinson
Ranch Hand
Posts: 287
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When students post their homework up on the forum and ask for help without showing any effort on their own part then people will always get a annoyed. If you then change the text of your original post then it just makes all the following posts look out of place. Isn't your new question answered by my previous post?

I suggest you try setting up a puzzle where the solution is 2 moves away then step through the following pseudo code:
 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Alina:
Mich Robinson has already given plenty of info to start with this problem.
Well only thing I would like to mention here is that to keep things tidy in your program, make sure you have a separate method to keep the legal moves on the side.




 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alina....if I was you, I´ll put each image in ArrayList and make the methods to move each image......and after a valid movement I´ll use the method remove() 'the image of current position' of ArrayList and add the image and other position.........more or less in this.....

I hope to help you....
 
reply
    Bookmark Topic Watch Topic
  • New Topic