I'm just finished my first year of CompSci at my college. I'm new to game programming, but I did very well in my programming classes, albeit the programming assignments were asinine and simple.
To practice and learn more I am creating a Minesweeper game in Java. So far I have been able to construct a board with various sizes depending on the users selection and then populate it randomly with mines. I have implemented flagging a square to disable it, and detonating all bombs on the field should you click on one. What I'm having trouble with is the recursive logic I need to implement should you click on a square without a bomb in it. I can only check itself and usually at most one other square.
My field is constructed of a 2D array of Mine objects that extend JButton.
What I need help with is figuring out how to recursively check all adjacent buttons, then should it not find any bombs in those, to call itself again.