3

I am a novice in C#.
I am looking for the code(s) of one or more chess program(s) written in C#.
Preferably, the code(s) should be short, clean, straightforward, very simple, and use only basic things (try to avoid complicated system namespace / library). It does not matter if the program is not very strong.
If you could also provide some explanations of the different parts of the code it would be even better.

The part of the code which interests me the most is the part which stores all the many millions positions at different depths.
Can this be done in a multidimensional array?
I was thinking that maybe the first two dimensions of the array could represent the two-dimensional boards, the 3rd dimension of the array could represent all the possible positions at a depth of 1 ply, the 4th dimension of the array could represent all the positions at a depth of 2 plies, the 5th dimension of the array could represent all the positions at a depth of 3 plies, etc... But perhaps that would be a little too messy.

  • 2
    "The part of the code which interests me the most is the part which stores all the many millions positions at different depths." There's no need to store all searched positions in a chess engine. The transposition table is used to store positions with the evaluation and the best move found in that position and the info on how deep that position was searched and perhaps some additional data. But not every position is stored in that, because there isn't enough memory. – JiK Dec 12 '14 at 22:30
  • Chess programming never use anything like a multidimensional array. – HelloWorld Dec 13 '14 at 16:52
3

Although it is written in C, you might want to take a look at Tom Kerrigan's Simple Chess Program (TSCP) which is created for this very purpose—to allow beginners to see what a simple chess engine is made of.

3

There is http://sharpchess.com/

And http://www.codeproject.com/Articles/36112/Chess-Program-in-C

But since chess engines are very cpu intensive and carefully tweaked for performance, if you want to do anything serious, you'd rather move to C/C++ as your implementation language.

And dont forget the wiki for chess programming: https://chessprogramming.wikispaces.com with many documented advanced techniques in the field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.