Page 1 of 1

Reputation:

# Finding the way Algoritm

Posted 22 June 2010 - 05:59 AM

Hello everyone. I do turn-based strategy in Flash. I need to deal with the algorithm search ways. Could you help me with this.
Is This A Good Question/Topic? 0

## Replies To: Finding the way Algoritm

### #2 macosxnerd101

• Games, Graphs, and Auctions

Reputation: 11315
• Posts: 42,622
• Joined: 27-December 08

## Re: Finding the way Algoritm

Posted 22 June 2010 - 06:27 AM

You might want to look into implementing a solution based in Graph Theory for this, and you can adapt Dijkstra's algorithm for finding all the paths, including the shortest.

Reputation:

## Re: Finding the way Algoritm

Posted 22 June 2010 - 06:50 AM

To be honest - I didn't understand nothing looking at the page in Wikipedia, can you tell me about "Graph Theory" easier?

In fact, in my game (as in all turn-based strategy) cells of this kind:

Reputation:

## Re: Finding the way Algoritm

Posted 23 June 2010 - 06:01 AM

Hey people! Somebody help me!

### #5 macosxnerd101

• Games, Graphs, and Auctions

Reputation: 11315
• Posts: 42,622
• Joined: 27-December 08

## Re: Finding the way Algoritm

Posted 23 June 2010 - 06:52 PM

That picture helps explain a lot. Honestly, it might be easier to just use a 2D array rather than a Graph, especially if you aren't familiar with Graph Theory. It sounds to me like you are trying to determine available spots to move to for a turn, correct me if I'm wrong. Some checks you should consider for this include checking to see if the space is adjacent to the current cell and is empty. If so, then it is a valid spot to move.