As promised earlier here’s how I do screen scrapping and tile recognition in my C# Bejeweled 3 Bot (for obvious reasons I will just insert relevant code snippets, for full source code you will have to see the repo that I will make available soon).
For the first time in my life I created a game playing bot (in this case Bejeweled 3). I did it so that you don’t have to spend significant part of your life playing it. Also I had some fun working on it and I wanted to see if I can actually pull it off. And I did!
What you can see below is the first working prototype, after I finish refactoring it I will write a series of posts on the prototype and then give you a link to my repo so you can also play a bit.
By no means the approach I’m showing here is revolutionary. The neat little trick immensely helped me once and I thought maybe it will be helpful for someone in the future. Imagine the following situation:
You know what? Just don’t name your variables temp. It’s an incredibly bad practice (no, I don’t have OCD). I saw many variations of usage of temp variables in all kinds of situations. But maybe I’m just unlucky. Let me show you some examples:
If you’re a beginning programmer you won’t understand a lot of the material, and if you are experienced, the book will only confirm what you already know. - Robert Harvey (?)