Your Job #1 is to explain the problem you are trying to solve. "the Minesweeper game" is inadequate. At minimum please provide a link to a precise statement of the rules of that game. As Jörg suggested, you should move your question to Code Revew (which provides advice on improving
working code, as opposed to SO's main reason for being: fixing broken code). To do so, flag your question for moderator attention, requesting that it be moved to Code Review. Alternatively, you can delete the question and re-post at Code Review. —
Cary Swoveland 40 secs ago