Nov 29, 2008

[Programming] Dependency on the static Mediocre-class

While going through the code I noticed many of the classes uses the static variables located in the Mediocre-class. It is not a good idea to use them directly like that, for the sake of encapsulation.

Examples of this is the Evaluation-class which uses evalHash and pawnHash that are located in the Mediocre-class.

So basically every class and method will get an extra argument where the used structure is passed instead.

[Programming] Interface finals

Somewhere in the very beginning of Mediocre I decided to make an interface called "Definitions" which would hold commonly used constants (like EN_PASSANT, W_KING etc.).

The use of an interface for this was something I thought was the "correct" thing to do at the time. However I have learned a lot about Java-programming since then and now I actually understand the real use for interfaces in Java (which in short is a kind of very basic blueprint for a class, which makes sure certain methods etc. exist).

However it seems I got a bit lucky while doing this. The interface is not "intended" to be used like this but it works very well.

The reason for this is that even though a real class with the same function could be created we would have to either use Definitions.W_KING to access the constants or extend the class, creating a subclass, which is not a good idea in the long wrong (a class can only extend one other class).

But since an interface is used it can be implemented instead, eliminating the need for the "Defintions."-part, while still making room for extending other classes if needed (and a class can implement many interfaces).

A problem would of course would be duplicate names (which can be avoided altogether with clever naming, but anyway) since a whole list of variable names gets taken in the Defintions-interface. However if this occurs, all that is needed is to use e.g. Defintions.W_KING again, defining which W_KING is meant.

In short, the definitions-solution I've used for two years now turned out to be a very good way to handle the constants. And I will stick to it.

[Other] Makeover and perhaps results eventually

I started to go through the code of Mediocre again and the first step is to get the (extremely) messy Board-class a bit more readable (and hopefully faster).

To achieve this I migrated the needed classes to a new project, the classes are Board, Move, Definitions, See and Zobrist. All used in some way when generating and making moves on the board. (although See is only used in one line of the Board-class, which i totally forgot what it did, I'll have to look into that)

Also I am extending the Perft-class to become a bit more functional when it comes to testing the moves on the board. Adding a main-method and support for automatically checking for correct values, as well as timing the operations.

A first step towards a total makeover of Mediocre, let's hope it lands somewhere good.

Nov 28, 2008

[Other] Links down (and up again)

So basically I let the blog die without notice, sorry about that. :) And apparently my hosting for the source and executables have also died sometime in the last couple of months.

I will get around to working on Mediocre soon enough. I just have to figure out what I want to do. I have been looking for online solutions where people can play against Mediocre and others using a simple applet, maybe that is something to start working with.

Anyways in the mean time I have put up the site on my University webspace with the not so beautiful address:

http://www.cs.umu.se/~c03jpn/mediocrechess/

(thank you George for making me aware of the dead links)

Mar 18, 2008

[Tournament] Ridderkerk and new tag

While I am at it I can sadly report that Mediocre just missed the promotion to division 4 in WBEC Ridderkerk. A very poor performance in the final unfortunately.

From now on I am going to use the [Tournament] tag for posts about various tournaments Mediocre participate in. Lately that is just about the only thing I have been posting so it deserves its own tag. :)

[Other] Latest executable on own server

Uploaded Jim Ablett's latest executable of Mediocre to my server on varten.org so now the link should not break for a while. :)

[Other] Link fixed again

Jim keeps changing his download link for the executables of Mediocre. :) I fixed the link yet again so it should work.

I will shortly take the time to download his executables to my webspace so they stay updated.

As for updates of Mediocre they will probably be some time off still. I recently started on a new job while still studying full time so not much time for any fun. :)

Jan 26, 2008

[Other] Sob and whine

I simply could not get Mediocre to work on Ubuntu through either Xboard or Winboard (using Wine). I had some trouble with it yesterday but thought I could fix it quickly today, I couldn't. :)

Well I will be more prepared before the next tournament. Sorry to CCT for the inconvenience.

[Other] Trouble with links

So one hour to CCT10 starts and I'm struggling to get Xboard and Mediocre to run on my new Ubuntu system. I guess Winboard through Wine will do it. :)

But I noticed Jim Ablett has moved his downloads (which I link directly to) so the executable downloads of Mediocre currently does not work, I will fix this as soon as I can.

Dec 31, 2007

[Other] Mediocre in CCT 10

I have entered Mediocre in the CCT 10 tournament which starts January 26.

"Hopefully" I will have had some time to work on Mediocre until then. Ponder, some endgame knowledge and a recap of the evaluation is on top of the list.