# Maximum PC

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

 All times are UTC - 8 hours

 Page 1 of 1 [ 5 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: How can I make a chess board using ASCII characters?Posted: Sun Jul 23, 2006 8:55 pm
 8086

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

Top

 Post subject: Posted: Sun Jul 23, 2006 9:22 pm
 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

 Post subject: Posted: Mon Jul 24, 2006 2:24 am
 Java Junkie

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

 Post subject: Re: How can I make a chess board using ASCII characters?Posted: Mon Jul 24, 2006 4:44 am
 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.

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.

Top

 Post subject: Posted: Mon Jul 24, 2006 5:21 pm
 8086

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

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 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 forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ Maximum FAQs    Forum Rules, Posting Guidelines & Announcements    The Good, The Bad & The Banned    FAQs Help/Do It Yourself    PC Building Lab    The Help Desk    PC Modding    Education & Certification Hardware    Nuts & Bolts    Portable Talk    Appraisals, Deals & Bargains (oh my!) OS/Software/Programming    Windows Parlor    Alt.OS.Abode    Games Arena    Programmers' Paradise Networking/Internet    Internet Truckstop    Network Nook In/Out    Magazine and Book Feedback    Forum & Website Feedback    Dog Pound Team Maximum PC Folding at Home    Team Maximum PC - Folding at Home - FIND CURES TO DISEASES    Team MPC - Folding Gauntlets