The comments are that you don't need an algorithm to build the game. I believe you mean an algorithm in the sense of solving and everyone might be understanding it that way as well.
However any solution to a problem can be considered an algorithm.
Like most math problems you can dissect the whole algorithm into smaller less complex algorithms, until you get down to something small enough to solve. This will get you the first correct solution. Later you can optimize the smaller algorithms in the context of the whole algorithm.
The gameboard can be thought of as a 2 dimensional array. You will have an algorithm associated with each operation. The first operation would probably be a randomly generated set of mine locations with x, y coordinates with a parameter of the number of mines and size of board. You would have another algorithm associated with revealing a square, which takes the board and a location and determines how many mines are adjacent to it. The final algorithm would take the board and check if any squares without mines are left to reveal.
Now you can take each of these algorithms and attempt to optimize each of them for better performance and say "what's the best way to count the squares with mines adjacent to a current square, given a 2 dimensional array using x,y coordinates.