Help with JAVA board game
I'm relatively new to JAVA programming, but have been set a task to create a basic board game and need some help to solve a problem which I've been racking my brain just to make a start on!
The premise of the game is that a 8x8 grid will be created by drawing horizontal and vertical lines within a window. Two players, Black and White, take turns to put a piece on the board; White moves first. No more than one piece may occupy any square, and pieces are never removed. The aim of Black is to build a path of black pieces between the left edge and the right edge of the board; and the aim of White is to build a path of white pieces between the top and bottom. Each path must consist of horizontally or vertically adjacent pieces (not diagonal!). The first player to construct their path wins.
In order to store the placement of the pieces, I have created a 2 dimensional array, with the squares of the grid referencing a slot in the array (i.e. the top left square will be 0,0 and reference the first slot in the array , and so on).
I have managed to get the game working, in that the board is created and the coloured counters are placed into the grid in the square clicked by the player. However, I have now hit a brick wall in the checking algorithm to find if a player has won.
I can't even think of a starting point! I don't want the exact code which I will have to implement, but a basic outline of the process of checking to see if a path has been created by either player which traverses the board as discribed.
Any help would be greatly appreciated!