views:

207

answers:

4

Hi , I wana develop a multi-player chess using c# but I don't have any idea of how to implement the restriction rules of chess with c# to be honest i've never done even a little bit of game programming in my life so that I don't have any idea of how to work in this area.

is there any simple sample of chess program source code out there? frankly i wasn't successful with searching about chess source code or how to implement the moves rules in chess.

so if you think that you can help me that would be appreciated.

regards.

+7  A: 

This was the first result from the Bing.com search "programming chess":

http://chessprogramming.wikispaces.com/

It seems to cover all the bases, for player vs. player or player vs. computer.

jrista
This is definitely the most comprehensive resource out there. You got you answer in a split second before I did. :)
LBushkin
@LBushkin: It looks pretty nice. :) I've been digging through it, there is a lot of great info there. I wish there was a site like this for programming Go, as I generally prefer that over Chess myself (however both are excellent strategy games.)
jrista
Wow people actually use Bing ?
JonH
I LOVE Bing! It returns great results on the first page, and I've gotten several hundred bucks back by using their shopping search. :)
jrista
A: 

Chess is a complex game. If you are new to programming, or this type of programming, I might suggest that you start with something similar but simpler (checkers comes to mind). This way you can get something working quickly and learn the basics (such as representing a board, moving pieces, etc) without suffering through the headaches associated with all of the particulars of chess.

danben
@danben: actually writing a **BASIC** chess engine isn't that hard. The hard part comes tweaking the engine to improve playability and balance.
Paulo Santos
+1  A: 

Think of a chess board as a 2 dimensional array with rows and columns, it consists of 64 squares so you have 8 * 8. So that is the base of your program. The next thing you have to think about is pieces, and rules behind the pieces. In addition, what are the legal moves for a knight, a pawn, a queen, etc.

It isn't complex if you break it all up into smaller tid bits, but I have never coded such an animal :). The rules can actually be stored in some sort of resource file or database. And you simply check if the move being made on the array is a valid move. If it is allow it, otherwise don't.

That is just a small start...

JonH
+1  A: 

I would start here.

The first thing would be the creation of a chess engine. From there the rest of the code should practically write itself.

Paulo Santos