Quantcast

Maximum PC

It is currently Thu Jun 20, 2013 3:27 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: How can I make a chess board using ASCII characters?
PostPosted: Sun Jul 23, 2006 8:55 pm 
8086
8086

Joined: Sat Apr 08, 2006 6:24 pm
Posts: 37
Writiing this game for a project deale. I need help. :lol:


Top
  Profile  
 
 Post subject:
PostPosted: Sun Jul 23, 2006 9:22 pm 
8086
8086

Joined: Sat Apr 08, 2006 6:24 pm
Posts: 37
wait nvm about this, but how could you create a chess board? I don't know much, but what about a matrix or using arrays? Im still a noob.


Top
  Profile  
 
 Post subject:
PostPosted: Mon Jul 24, 2006 2:24 am 
Java Junkie
Java Junkie
User avatar

Joined: Mon Jun 14, 2004 10:23 am
Posts: 24159
Location: Granite Heaven
An array would be a good way to represent the places on a chess board in your program.

Your question is too vague to provide a better answer than that, though.


Top
  Profile  
 
 Post subject: Re: How can I make a chess board using ASCII characters?
PostPosted: Mon Jul 24, 2006 4:44 am 
Team Member Top 100
Team Member Top 100

Joined: Sun Feb 12, 2006 2:52 pm
Posts: 1984
Location: Cryptogram City!
Teenager Enthusiast wrote:
Writiing this game for a project deale. I need help. :lol:


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.

Adak


Top
  Profile  
 
 Post subject:
PostPosted: Mon Jul 24, 2006 5:21 pm 
8086
8086

Joined: Sat Apr 08, 2006 6:24 pm
Posts: 37
i see thnx for the help


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group