Over 10 months ago I decided to take part in a 12 books challenge. So far I finished 4 books and I’m hoping to finish 1 or 2 more. The fact is that I won’t read 12 technical books this year but that’s OK.
I finished reading C# in Depth by John Skeet. I’m sure John Skeet’s book will stay on my shelf for years to come. The special thing about this book is that it takes a reader for a journey. The journey starts with C# 2.0 and slowly introduces new concepts introduced in the C# and .NET on the way to C# 5.0.
Making mouse move and click on stuff in C# is probably the easiest thing I did in my life. Here is the class:
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.
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: