A new comers question: easiest way to represent a board

Discussion of chess software programming and technical issues.

Moderator: Ras

jix

A new comers question: easiest way to represent a board

Post by jix »

So after many years of studying various open source chess engines I have decided to jump in feet first and make one of my own; however, I am having a hard time deciding how to represent the board.

I've been thinking that a simple 0-63 array would be the easiest way to go, however, I am worried about whatever short comings this method might have further into the engines development. Should I be worried about using this method of board representation, or should I consider a 0x88 board as an alternative.

Any advice would be great!

Cheers
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: A new comers question: easiest way to represent a board

Post by bob »

jix wrote:So after many years of studying various open source chess engines I have decided to jump in feet first and make one of my own; however, I am having a hard time deciding how to represent the board.

I've been thinking that a simple 0-63 array would be the easiest way to go, however, I am worried about whatever short comings this method might have further into the engines development. Should I be worried about using this method of board representation, or should I consider a 0x88 board as an alternative.

Any advice would be great!

Cheers
go to www.cis.uab.edu/hyatt/pubs.html

and look at the "board representation topic". That should answer your questions as it covers about any approach you might think of.
Suji

Re: A new comers question: easiest way to represent a board

Post by Suji »

Dr. Hyatt gives a great link...Speaking of which, I need to bookmark it.

I'm a beginner like you, and I'm using the 0x88 method. I personally feel that it is the easiest board representation. Like everything else, it does have it's own drawbacks. I feel, though, that the drawbacks are outweighed by the simplicity that it brings.

A good starting point, at least for me was the engine Mediocre. It's written in Java, but it's well written and easy enough for me to understand. That's how I programmed my board representation, I translated from Java to C++.

I'm at the point where I don't want to look at the code so much for the move generation, since I want my engine to be "different" than Mediocre.

Here's the link for Mediocre. http://mediocrechess.blogspot.com/
User avatar
Onno Garms
Posts: 224
Joined: Mon Mar 12, 2007 7:31 pm
Location: Bonn, Germany

Re: A new comers question: easiest way to represent a board

Post by Onno Garms »

As I understand your posting, you are more asking for recommendations then for an overview.

In case I got you wrong, read
http://chessprogramming.wikispaces.com/ ... esentation

Otherwise: For a novice I would strongly recommend not to use bitboards. They are not that much faster as one would expect (on 32 bit systems maybe even slightly slower), but more difficult to handle than 12x16 or similar.
I've been thinking that a simple 0-63 array would be the easiest way to go, however, I am worried about whatever short comings this method might have further into the engines development.
Definitely slower then say 12x16, but I'm not sure how much. I think not easier either, because you don't have sentinels for sliders and therefore have to write more complicated code.