Thursday, April 27, 2006

Grown men don't cry

They say it's always darkest right before the dawn. My goal for today was originally simple - create my presentation. Unfortunately I got caught up in the fact that my engine COULDN'T FIGURE OUT how to deal with a SIMPLE mate. It was terrible. I was crying my eyes out. How can you have a chess program that doesn't know how to mate? Even when it knew there was a mate, it still wouldn't play it. It was very frustrating. I spent ALL DAY on it. At about 5:30 I actually screamed. Seriously. I yelled, grabbed my head and shook it, and walked around for a minute to let the frustration out. It was a terrible moment.

Then I decided to forget about it. My next week will totally suck trying to fix it and get it working while also having to write the research paper, but it is what it is. Of course, I also still have to figure out hash tables and the opening book. So a LOT to do in the next week. But I decided I had to stop working on it and focus on the presentation, knowing I'd have to minimize and tightly control the demo portion of it. So, I got my presentation reasonable by shortly after 8pm and focused on some of the other things with the engine. Simple things like adding bonus tables for certain pieces on certain squares so that some pawns will know they belong home while others should be closer to the center. Knights belong on squares where they have the most mobility, and bishops like the long diagonals. So I made some simple enhancements, and decided to take another crack at the checkmate problem. It's been killing me for days.

As I was trying to get a fresh perspective I found a site that talked a little bit about the implementation and showed some pseudo-code. I decided that even though I wasn't completely pleased with where my presentation was at it was good enough, and it would be much better if I could actually handle the checkmate problem. So I started reworking my code using the newfound knowledge.

So, I'm now very happy with my presentation and my engine can mate your . I can't believe that so much of it came through at the last minute. If you were out there praying for me, thank you. I think I needed it! I even added some performance comparisons against having it run on my mac. It's actually quite interesting. And it appears that Microsoft Visual C# 2005 does a much better job of optimizing the exe than mono on the mac does. On the mac when I run the VC# exe it runs about 50% faster than the mono exe. It's still cool that it runs on both platforms without issue. I know, it's actually running through the .NET/Mono framework and not really running as a native exe so it should be able to do that. It's just cool to see it.

There is still a lot to do, and a few bugs I know about, but it's a major step for me. The next major thing will be the hash tables/opening book. A week to go, then I can continue on it at a more reasonable pace.

Earlier in the evening, maybe around 7 my brother started calling and banging on my door. I wasn't pleased about the interuption because my project was, as you know, killing me. What a surprise! There was a bear across the street. I took a few pictures. It was really a site to see. I'd never really seen one so close before. It was a baby... but I wouldn't want to wrangle with it.

Alright, time for bed.

Wish me luck tomorrow night!

Ed.

No comments: