English 中文(简体)
how to develop a multi player chess?
原标题:
  • 时间:2010-02-24 19:15:26
  •  标签:
  • c#
  • .net
  • chess

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.

最佳回答

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

https://www.chessprogramming.org/Main_Page

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

问题回答

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.

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...

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.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签