Tuesday 15 July 2008

State of play

So... where were we?

As it stands, I've completed stages 1 and 2 for both Aardvark and Beaver. That is, I've coded the board and tiles for each, and implemented the tile placement rules and scoring. As mentioned in another post, I'm concentrating on Beaver right now and have started on stage 3: implementing tile placement strategies.

To keep the project's momentum, I started with an incredibly thick strategy. All it did was find the first tile it could place anywhere on the board. Even then, it would give up if it couldn't find a suitable tile in the first few available to it. A good player it was not.

Despite the strategy's inherent stupidity, it was a moment of great joy when I pitted it against itself in the first ever computer vs. computer game of Beaver. And for the record, player 2 won. Yay for player 2! ;)

Actually, such was the sense of accomplishment at this minor victory that I stopped for the night there and didn't return to programming for over a week. So much for my momentum, eh? ;) At least it gives you an idea of my lack of dedication. Maybe now you understand how my projects usually end up in the coding graveyard. Hehe.

A week or so later and I returned to Beaver, implementing another 3 variants on this strategy, culminating with one that found the best possible tile to play, but without any kind of look-ahead. I'm sure that, in the States, it would be called the scoringest tile. Whatever, watching these fellas fight it out was humbling. Immediately, I could see they were playing better than I could. Bastards.

Anyway, that's where things stand. None of the strategies currently has any unit tests around it. I simply didn't know how I could write a decent test, as any one case would exercise a tiny fraction of the game space (if that's the right term). Furthermore, with the strategies themselves evolving rapidly, I didn't see the value in cementing them in place with tests.

Instead, the approach I took was to just watch them play in the bare-bones UI (more on that in another post, maybe). It's a pity I can't include any screenshots or video here, as it was pretty cool to watch. Thing is, while it shows promise, it's valuable IP, so I've got to keep it secret. Just trust me: it's fun to program, at least.

Anyhoo... next up, it's decision time. Up-front design of a minimax architecture, or more exploratory coding? Hmmm... I'm not sure, but I suspect the latter may win, as I can feel Dr Procrastination creeping up to finger my colon...

No comments: