Beginner's section on Basic concepts of chess theory

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

mjlef
Posts: 1494
Joined: Thu Mar 30, 2006 2:08 pm

Re: Beginner's section on Basic concepts of chess theory

Post by mjlef »

Richbell wrote:http://www.geocities.com/axchess/firstchess.html

You could add this resource to Wiki. Very simple source code for beginners.
Yes, it is simple, but lacking castling and en-passant, which are some of the harder parts for beginners to get right. Any chance of adding those to make it a complete example?

Mark
User avatar
pedrox
Posts: 1056
Joined: Fri Mar 10, 2006 6:07 am
Location: Basque Country (Spain)

Re: Beginner's section on Basic concepts of chess theory

Post by pedrox »

mjlef wrote:
Richbell wrote:http://www.geocities.com/axchess/firstchess.html

You could add this resource to Wiki. Very simple source code for beginners.
Yes, it is simple, but lacking castling and en-passant, which are some of the harder parts for beginners to get right. Any chance of adding those to make it a complete example?

Mark
DanaSah is an engine that is based on FirstChess.

Now, DanaSah has an ELO around 2500 points and is using the generator moves of FirstChess and IsInCheck. I seem to remember that the generator move had some minor bug in promotions. The board of FirstChess is an array of 64 elements, it does not use any trick as mailbox, 0x88 or bitboards.

I added the ability to castling and ep in the code. FirstChess not available quisce and therefore has no generator of captures, which also had to do. FirstChess not check repetition of moves and the rule of 50 moves.

I make FirstChess to do play and I realized as in the move number 4 was left one-piece, FirstChess evaluates only the material, but that is no reason to lose a piece.

Human - Program

1.e4 Na6

2.d4 Rb8

3.Nf3 Ra8

4.Bxa6 Rb8

Best,

Pedro
Aleks Peshkov
Posts: 892
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia

Re: Beginner's section on Basic concepts of chess theory

Post by Aleks Peshkov »

pedrox wrote:DanaSah is an engine that is based on FirstChess.
DanaSah comments, functions and variables names are not in English...

OTOH SamChess source code is very small. Do not know about bugs and playing strength.
User avatar
pedrox
Posts: 1056
Joined: Fri Mar 10, 2006 6:07 am
Location: Basque Country (Spain)

Re: Beginner's section on Basic concepts of chess theory

Post by pedrox »

Aleks Peshkov wrote:
pedrox wrote:DanaSah is an engine that is based on FirstChess.
DanaSah comments, functions and variables names are not in English...
True, in DanaSah the comments and the majority of functions and variables are in spanish.

I might add if it is interesting code to firstchess in english (bad english) the things necessary for the generator moves make castling and ep.

Another of the things that the generator moves not advance the pawns 2 squares.

I would recommend for beginners study the code FirstChess as it is, then once understood, consider for example the code TSCP. TSCP make castling and ep and the code is easy to implement in FirstChess.

Best,

Pedro
Chris Tatham
Posts: 142
Joined: Wed Mar 08, 2006 8:15 pm

Re: Beginner's section on Basic concepts of chess theory

Post by Chris Tatham »

And this new chess programming wiki (still in progress):

http://chessprogramming.wikispaces.com/
Hi Mark & other contributors

The site looks a great new resource for novice coders like me.

Many thanks :)

Chris
mjlef
Posts: 1494
Joined: Thu Mar 30, 2006 2:08 pm

Re: Beginner's section on Basic concepts of chess theory

Post by mjlef »

Thanks. But you know, a novice can bring a fresh perpective, and make suggestions and contribute too!