Handling Mouse

Making mouse move and click on stuff in C# is probably the easiest thing I did in my life. Here is the class:

Continue Reading ...

Summing up the last post: we can now identify the gems on the board and produce an array containing color indices.

The move class

I love writing ‘simple’ code that speaks for itself. Does it make the code slower? Maybe, but until I don’t experience any sluggishness on my 3 years old low end laptop then I don’t care! Clarity comes first, then comes optimization if it’s needed.

Continue Reading ...

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).

Continue Reading ...

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.

Continue Reading ...

https://en.wikipedia.org/wiki/Rubber_duck_debugging

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:

Continue Reading ...
Don't name your variables 'temp'

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:

Continue Reading ...

Code Complete Cover

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 (?)

Continue Reading ...