Finding if a path between 2 sides of a game board exists
Posted
by Meny
on Stack Overflow
See other posts from Stack Overflow
or by Meny
Published on 2010-04-02T03:14:15Z
Indexed on
2010/04/02
3:23 UTC
Read the original article
Hit count: 252
Hi,
i'm currently working on a game as an assignment for school in java. the game cuurently is designed for Console.
the game is for 2 players, one attacking from north to south, and the other from west to east. the purpose of the game is to build a "bridge"/"path" between the 2 of your sides before your opponent does.
for example:
A B C D E F
1 _ _ X _ _ _ 1
2 O X X _ _ _ 2
3 O X O O O O 3
4 O X O _ _ _ 4
5 X X _ _ _ _ 5
6 X O _ _ _ _ 6
A B C D E F
player that attacks from north to south won (path/bridge from C to A) my problem is, what algorithm would be good to check if the user have managed to create a path (will be checked at the end of each turn).
you're help would be very appreciated.
© Stack Overflow or respective owner