Board Representation

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Board Representation

Postby Terry Bolo » 14 Jun 2006, 08:47

Hi all, my apologies for my dumb question but i'm new to programming in general. I want to create a simple chess engine but i do not have the skill to do so as i'm learning c++ currently. All i want to do for now is find a way to represent the board. I have read Dr. Hyatt's page and decided to use 0X88 board representation but i'm still a little confuse.

For example i would define the board as
Code: Select all
int board[128]
Code: Select all
int piece_color_white = 1
Code: Select all
int piece_color_black = 0
Code: Select all
const int pawn = 100
Code: Select all
const int torret = 500
Code: Select all
const int night = 300
Code: Select all
const int bishop = 300
Code: Select all
const int Queen = 900
Code: Select all
const int king = 5000

Here's my problem and not sure what to do next. Can someone please give me some hints. Thanks
Terry Bolo
 
Posts: 2
Joined: 13 Jun 2006, 23:13

Re: Board Representation

Postby Harald Lüßen » 14 Jun 2006, 18:27

Terry Bolo wrote:Hi all, my apologies for my dumb question but i'm new to programming in general. I want to create a simple chess engine but i do not have the skill to do so as i'm learning c++ currently. All i want to do for now is find a way to represent the board. I have read Dr. Hyatt's page and decided to use 0X88 board representation but i'm still a little confuse.
...
Here's my problem and not sure what to do next. Can someone please give me some hints. Thanks


Learning C++ _and_ chess programming is not a good idea.
Either you will do it very C++ like and end up with a strange
chess program or you will write a reasonable chess program
that looks like C and not C++. Chess in C++ can be done but
it is hard for a beginner.

Reading Bob's page alone is not enough. Find and read more
texts about chess programming, e.g.
http://www.brucemo.com/compchess/programming/

Here was a thread for chess programming beginners in a forum
at TalkChess.com:
http://216.25.93.108/forum/viewtopic.ph ... 586&t=3294
http://216.25.93.108/forum/viewtopic.ph ... 610&t=3294
http://216.25.93.108/forum/viewtopic.ph ... 166&t=3294
Perhaps these links work, I don't know.

In your code:
const int torret = 500; // torret is better known as rook.
int board[128]; // char board[128] ?
You have to decide but first you have to understand.
const int king = 5000; // Kings cannot be captured. Why a value?
And why piece values in centipawns for the board representation?
For pieces on board better use something like
1 = white pawn, 2 = white knight, ..., -1 or 7 = black pawn, ...

And regarding C++, where is a position class?

See, you just jumped in very cold water to learn swimming.
Have a warm welcome here. ;-)

Harald
User avatar
Harald Lüßen
 
Posts: 29
Joined: 09 Oct 2004, 22:39

Re: Board Representation

Postby H.G.Muller » 14 Jun 2006, 22:04

User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Board Representation

Postby Terry Bolo » 15 Jun 2006, 01:40

Thanks for the links.
Terry Bolo
 
Posts: 2
Joined: 13 Jun 2006, 23:13


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 44 guests