I'm working on a game as an assignment for school in java. The game currently 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
The 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 has managed to complete a path (it will be checked at the end of each turn).