aspose file tools*
The moose likes Game Development and the fly likes Tile Game Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Game Development
Bookmark "Tile Game " Watch "Tile Game " New topic
Author

Tile Game

Alina Gilbard
Greenhorn

Joined: Apr 23, 2011
Posts: 3
how can i use ID-DFS algorithm for a tile game.?


[Thumbnail for puzzle.jpg]

Alina Gilbard
Greenhorn

Joined: Apr 23, 2011
Posts: 3
help........
Mich Robinson
Ranch Hand

Joined: Jun 28, 2009
Posts: 250
    
    1
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?


Arcade : Alien Swarm
Board : Chess - Checkers - Connect 4 - Othello
Alina Gilbard
Greenhorn

Joined: Apr 23, 2011
Posts: 3
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

Joined: Jun 28, 2009
Posts: 250
    
    1
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

Joined: Jun 28, 2009
Posts: 250
    
    1
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:
Ashish Schottky
Ranch Hand

Joined: Dec 29, 2009
Posts: 93
@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.




Fernando hiar
Greenhorn

Joined: Jan 11, 2008
Posts: 29
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....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tile Game