As Henri mentioned, the correct way of solving minesweeper is with mathematics, specifically Linear Algebra Matrix mathematics for the deterministic part. I have a whole post here that:
- explains how that method works
- has working code that you can compile and run on any platform
- contains the code to make the game and a solver too
You can see that all here: https://massaioli.wordpress.com/2013/01/12/solving-minesweeper-with-matricies/
I would recommend reading through that and then having a good thought about it. The probabilistic part of Minsweeper can be solved using statistics too but I don't have a good plan for that yet. However, other people have looked into it too.