Solving Minesweeper – Part 1: The Plan

What i will attempt in this multi part post, is to write an application that will be able to play and solve Microsoft Minesweeper. I know it feels ambitious but i think we can make it happen. Since this is my first post where i don’t actually know how and what will i do, i cannot promise i won’t change technologies or frameworks in the meantime. So strap yourselves in and lets think it through.

I approach this like any other larger scale work i need to do, i break it down to smaller more manageable items, then devise an approach for each of them.

  1. I need to get the current image of Minesweeper. Whenever you press ALT + PRINTSCR in a window, the contents of that window gets copied into the clipboard. I know i will find something in WinAPI that will help me with that.
  2. I need to analyze the image and extract the current state of the board. I can approach this by doing pattern matching on the image either writing it myself or using an image analysis library like OpenCV
  3. I need to write the logic which detects where the mines are. I will probably use an approach like what i used in the Solving Sudoku post.
  4. I need to make actions in the game. In the past i worked with moving the mouse and issuing click commands from my application using WinAPI

A lot of time past since my last post and you probably think i was slacking off. It’s nothing like that. I had this idea a while ago and i spent some time researching each problem we need to solve, in my after work and after family hours.

I’m looking forward to this and see you soon.

SOLID Principles – Intro

You must be thinking “Great, another schmuck who tries to explain them, the internet doesn’t need another series dedicated to SOLID!” You are right, this topic has been explored many times before, and certainly you will find better explanations out there. Every year thousands of new students enter the workforce in our wonderful industry. Even if there were courses in their University, or made the research themselves, only after they build up more experience can they truly cherish these simple, and in the same time complex principles.

To explain it better, let me use some chess analogy. I love this game and you will see if you follow my writing that I draw great inspiration from it. It heavily influenced the way I work and I apply a lot of habits, which I learned while playing. Try to guess who is better in this position.

Continue reading

So what am I doing here?

To be perfectly honest, I’m not so sure. Lately i started to reflect on software craftsmanship a lot, not only regarding my own career, but also through discussions I have with more, and with less experienced colleges.

Since these topics are interesting, I though there might be others out here that would enjoy this, so i immediately thought about you, my dear reader who might be taking the same turns in your own roller-coaster ride called “career” as me.

I don’t know everything, god knows there are some days i feel like “i don’t know anything!”, so i’m not promising you wisdom or advice, i can only offer my own view and experience about some of the practices, situations, methodologies and struggles that one might encounter while working as a software developer.

I hope my posts will be useful or at least entertaining, otherwise they would be useless as Manoj Bhargava would put it. See you soon!