A tribute to chess programming community

Discussion of anything and everything relating to chess playing software and machines.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
maksimKorzh
Posts: 81
Joined: Sat Sep 08, 2018 3:37 pm
Location: Ukraine
Full name: Maksim Korzh
Contact:

A tribute to chess programming community

Post by maksimKorzh » Mon Mar 11, 2019 9:53 pm

Hi, guys!

The chess programming community gave me so much for the last three years
and now I'd like to give it something back. I couldn't write a strong chess
program so far and won't do that probably ever for many reasons, so I've chosen
a different approach - minimalist chess. Being inspired by Bluefever's Software
VICE(video internet chess engine) video series I decided to create my own, much
shorter one, targeting the very beginners. So for those of you who has already
written 1800+ ELO rated engine this series is not going to be interesting, but
for those who has never tried chess programming before and is looking for some
easy way to jump right in this series might be interesting.

I've written a very primitive chess program called "bare minimum chess program"
and made a some sort of the video tutorial explaining how it works. It is intended
to those who already knows how to code in C but didn't try to write a chess program yet.

The source code is based on the ideas taken from the great micro-Max engine
by H.G. Muller, who has spent quite a several pages at technical discussion
thread in order to explain to me how particularly his program works.

So a deep bow to you, Mr.Muller!

full source code: https://github.com/maksimKorzh/bmcp
YouTube tutorial: https://www.youtube.com/playlist?list=P ... pxazkGoh16

Dann Corbit
Posts: 10188
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: A tribute to chess programming community

Post by Dann Corbit » Mon Mar 11, 2019 10:38 pm

I would skip the unicode output and just print a text representation.

Code: Select all

bmcp-commented.c(136) : warning C4566: character represented by universal-character-name '\u265F' cannot be represented in the current code page (1252)
bmcp-commented.c(136) : warning C4566: character represented by universal-character-name '\u265A' cannot be represented in the current code page (1252)
bmcp-commented.c(136) : warning C4566: character represented by universal-character-name '\u265E' cannot be represented in the current code page (1252)
bmcp-commented.c(136) : warning C4566: character represented by universal-character-name '\u265D' cannot be represented in the current code page (1252)
bmcp-commented.c(136) : warning C4566: character represented by universal-character-name '\u265C' cannot be represented in the current code page (1252)
bmcp-commented.c(136) : warning C4566: character represented by universal-character-name '\u265B' cannot be represented in the current code page (1252)
bmcp-commented.c(137) : warning C4566: character represented by universal-character-name '\u2659' cannot be represented in the current code page (1252)
bmcp-commented.c(137) : warning C4566: character represented by universal-character-name '\u2654' cannot be represented in the current code page (1252)
bmcp-commented.c(137) : warning C4566: character represented by universal-character-name '\u2658' cannot be represented in the current code page (1252)
bmcp-commented.c(137) : warning C4566: character represented by universal-character-name '\u2657' cannot be represented in the current code page (1252)
bmcp-commented.c(137) : warning C4566: character represented by universal-character-name '\u2656' cannot be represented in the current code page (1252)
bmcp-commented.c(137) : warning C4566: character represented by universal-character-name '\u2655' cannot be represented in the current code page (1252)
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.

maksimKorzh
Posts: 81
Joined: Sat Sep 08, 2018 3:37 pm
Location: Ukraine
Full name: Maksim Korzh
Contact:

Re: A tribute to chess programming community

Post by maksimKorzh » Mon Mar 11, 2019 10:40 pm

Text representation is also available, thanks for your feedback, Dann. Just uncomment the pieces[] = ",-pknrbkq-P-KNBRQ" array and the corresponding line in PrintBoard() function.

To make it look like this:

Code: Select all

void PrintBoard()
{
    for(int sq = 0; sq < 128; sq++)
    {
        if(!(sq % 16)) printf(" %d  ", 8 - (sq / 16));    // print ranks to the left of the board
        printf(" %c", ((sq & 8) && (sq += 7)) ? '\n' : pieces[board[sq] & 15]);    // ASCII pieces
        //printf(" %s", ((sq & 8) && (sq += 7)) ? "\n" : pieces[board[sq] & 15]);    // unicode pieces
    }
    
    printf("\n     a b c d e f g h\n\nYour move: \n");
}

Post Reply