Java Minesweeper solution