

That is good, but I want a robust math-based solution to this problem. Those of you that have played minesweeper before should be able to solve this configuration as best as you can using the intuition that you have learned from playing many games. Here is a very small minesweeper configuration and we will be using this as our simple example: This is a simple example of Minesweeper taken from That is exactly the process that we are going to go through here. Once you have that model you then apply it to more complicated scenarios and problems and you discover, to your pleasure, that you did it. Using the simple example you then develop a rigorous model for solving the problem in general. You use a simple example because it is easier to conceptualise. When dealing with a new problem it helps to first start with a simple example.
#MINESWEEPER SOLVER PLUS#
On the plus side, your C++ reading comprehension will improve.
#MINESWEEPER SOLVER CODE#
To read the code you will also need to understand C++ the coding could have been better, sorry. You can play Minesweeper on Windows, Linux and OSX there are ports for every OS.
#MINESWEEPER SOLVER HOW TO#
I don’t explain the general rules of minesweeper, if you want to know how to play then go read the rules or, better yet, go play a game before reading this post. Really go learn about it it will take time but it is worth it. If you don’t know what matrices are then go lean about them, they are very useful tools in a programmers toolkit and you certainly need them for Video Game Development.

Please note that I will try and provide code links, where possible, so that you can follow along in the code.A brief description of my implementation of this method which is available on BitBucket:.A robust and reasonably efficient general algorithm that explains how to apply this in the real world.A simple example of how this method works and can be used to find solutions to Minesweeper configurations.I believe that Matrices are just the natural way to solve this kind of problem. And I am sure that there are people that worked that out before we did again. Here is a website of somebody that discovered it two years after I did. Just as a side note: I want you to know that I am not unique in finding this method of solving Minesweeper. It was a fair bit of work but I hope that you enjoy the end results. So I have decided to explain this method fully and provide a working implementation. So I made a comment to that affect on Reddit and I gained some interest from people that wanted to know how to do that and how it was possible. However, one thing bugged me, nobody seemed to realise that you can actually solve Minesweeper by using Matrices (and one special lemma specific to minesweeper). It was a pretty cool blog post and it explained a method of solving minesweeper and how you would go about doing that. And then, as I wrote out a simple game of minesweeper it hit me, you could solve Minesweeper with matrices I then proceeded to write program that did exactly that, it solved minesweeper as best as it could without probabilities.įast forward to just last month, just before Christmas, when I checked Reddit and saw the following blog post get released: But as I watched them play I came to realise that it really was a simple game and probably something that would be better suited to a computer solving. While in the computing lectures and in the grounds and basements around campus I had a friend that loved to play Minesweeper and boy were they fast. I was also enrolled in your standard first year Maths course at the time and we were just learning Matrix mathematics. I was actually enrolled in the course that became those famous YouTube video lectures on Computer Science by Richard Buckland. Note: skip to the next section if you don’t care about the back-story and want to get straight to the actual algorithm.īack in 2008 I was starting Computer Science at UNSW. What is your motivation for writing this? Robert Massaioli on Solving Minesweeper with …ĭarrell Pittman on Solving Minesweeper with …ĭavid McDermott on Solving Minesweeper with … Setdown: the best tool for fast and repeatable line based set operations.How to control a Quartz Clock Mechanism.Collecting audio samples of the English Alphabet.Can my Tesla Model S be charged daily by the Solar on my roof?.
