Teenager Enthusiast wrote:
Writiing this game for a project deale. I need help.
I use a 2D array for my chess program. Many authors use a single dimension array, but I don't recommend it for beginners.
For a very basic chessboard, you can use ascii char's just fine. The generally accepted way of showing the pieces on the board looks something like this:
-R- -N- -B- -Q- -K- -B- -N- -R-
-p- -p- -p- ...,
for Black's starting position. White would look similar, but have (perhaps), +R+ +N+ +B+ , (plus epalets instead of minus). Some also use Capital letter only for White, lowercase for Black.
This looks very good on a square which is 5 char's wide, btw. Center it right in the middle of each square. If the square is 6 char's wide, it has no real center char position, and 3 char's wide just looks funny.
It's important to have the font be one that suits your size, as well. Your console window can have it's fonts changed around in height, and in the width of the font, as well. Something to play with until it pleases you.
You can use ascii char's 176, 177 or 178 as "texture" for the surface of the board, and do try different colors for foreground and background.
If you're coding this in C or BASIC, I can send you some code. You should also Google for "Toms Simple Chess Program" aka "TSCP", and study a rather clean first chess program. "First Chess" is another one.
For a better look (okay, much better), you may want to shoot for using Winboard as your IO program. Not only will it look sharp, but it will allow your program to play against other programs, or people, with a consistent interface you don't have to design. It's widely used.
There is also the Winboard Forum and Talkchess.com, for forums to discuss everything. Be sure to state that you're a real beginner in your post. Otherwise you'll get answers that will fly past your head at 90 m.p.h, with no brakes. Talkchess is at www.talkchess.com
. The usenet group RGCC (Recreation Games Chess Computer), also is a valuable resource, although it's a newsgroup and has it's oddballs, as well. No moderation.
Let me know also your OS and programming language.