Game Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesGame Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old October 13th, 2007, 11:59 AM
Untitled1234 Untitled1234 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 2 Untitled1234 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 17 m 9 sec
Reputation Power: 0
Lightbulb Complete Chess Game with just TURBO C++

Hey guys!!

I am Planning on Creating a Computer vs. User Chess game involving Artificial Intelligence... by just using TURBO C++

This is NOT impossible!! Please understand that my seniors achieved this last year and they had hardly a month's time to do it!!

But then i want to do it and develop it better than them!

This is for a school project BTW.

I want a lot of help though!

1. Do i use a 2d ( 8*8 ) array to represent the board??
2. How do i give life to the pieces?
3. I am planning on using Linked lists to create hierarchical trees ( Cuz thats what my seniors used ) and i think there is no other alternative as far as TURBO C++ is concerned.... But then even though i know how to use linked list i don't know how to go about it in the chess program...
4. What kind of variables should i use?? and what are the variables for anyway??
5. I also heard about recursive loops, which i think is essential for a chess game!! But then i don't know anything about it!!
6. I would also need help on the evaluation process where the computer does the evaluation to choose the best move out of all the possible ones... How is it done???
7. Other than all this i would also need very little help in graphics and other stuff in which i represent the game ( The timer, The board, the pieces, The moves which i have to represent like e4 to e5 etc. etc. )


So if anyone has the patience to just give me information on the above mentioned topics and help me with some code snippets and small algorithms, It would be real nice!!

And please help me understand the use of each variable that you will be using in your code snippets if you are helping me!!

Thank you!!

P.S. PLEASE DON'T DISMISS THIS TOPIC BY SAYING WHAT I AM ASKING FOR IS IMPOSSIBLE AND STUFF LIKE THAT. MY SENIORS WERE MY AGE WHEN THEY DID IT. AND THEY TOO HAD ONLY A YEAR AND A HALF EXPERIENCE IN C++ ( SAME AS ME ). ITS IS POSSIBLE AND I THINK I HAVE THE POTENTIAL TO ACHIEVE THIS!! ( WITH THE HELP OF YOU PEOPLE )

Untitled1234

Reply With Quote
  #2  
Old October 13th, 2007, 02:04 PM
Oler1s Oler1s is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2006
Posts: 1,476 Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 4 Weeks 12 h 46 m 31 sec
Reputation Power: 426
Look at http://www.thescripts.com/forum/thread722717.html. Could that be you, posting on multiple forums? Hmmm.

EDIT:
In any case, here's what your question is like: I have no idea what I'm doing, tell me everything I need to know to build the chess program.

If that's the case, we might as well code the chess program ourselves.
__________________
C/C++: Books, C FAQ, C++ FAQ, C/C++ Reference.
Python: Website, Beautiful Soup.

Reply With Quote
  #3  
Old October 13th, 2007, 04:54 PM
0CIRCLE0 0CIRCLE0 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 59 0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 18 h 48 m 59 sec
Reputation Power: 84
Quote:
4. What kind of variables should i use?? and what are the variables for anyway??
5. I also heard about recursive loops, which i think is essential for a chess game!! But then i don't know anything about it!!
6. I would also need help on the evaluation process where the computer does the evaluation to choose the best move out of all the possible ones... How is it done???
7. Other than all this i would also need very little help in graphics and other stuff in which i represent the game ( The timer, The board, the pieces, The moves which i have to represent like e4 to e5 etc. etc. )


1 year 6 months of knowledge of c++ and these are your topics of things you can not do? If you don't know what kind of variables you "should" use when you "could" use anything you wanted then your in trouble.

Quote:
and what are the variables for anyway??

LMAO I laughed hard at this one. 1 year 6 months wasted.
Comments on this post
gimp agrees: In one year six months of java prorgamming I was making a card game platform akin to that of
Yahoo... (No, obviously not as good or close.)

Reply With Quote
  #4  
Old October 13th, 2007, 07:10 PM
0CIRCLE0 0CIRCLE0 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 59 0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 18 h 48 m 59 sec
Reputation Power: 84
Off_topic = TRUE;

Thanks for the rep gimp.

I have no programming training what so ever. Learned everything I know from a book or fifteen. Making a chess game sounds interesting to me but I just want to make any board game. More likely to make my most hated game Sudoku. I can't stand to play it but the concept of the game seems like a very interesting programming project.

Off_topic = FALSE;

As for him telling US THAT IT IS POSSIBLE. Heck you can make the game in QBASIC or even ASM.

return 0;

Reply With Quote
  #5  
Old October 24th, 2007, 08:28 AM
Dijkstra Dijkstra is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Location: UK
Posts: 71 Dijkstra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 17 h 32 m 13 sec
Reputation Power: 1
Quote:
Originally Posted by 0CIRCLE0
Making a chess game sounds interesting to me but I just want to make any board game. More likely to make my most hated game Sudoku. I can't stand to play it but the concept of the game seems like a very interesting programming project.


Sorry, still off topic...

For Sudoku, I wrote a simple program that gave me an indication of how difficult it was to fill another square of a given puzzle correctly. e.g. if any column/row/box has an entry with a single possibility in relation to the rest of the column/row/box that that is defined as a "1 hop logic" (easy). But if I can fill entry A, which in turn forces another entry B to be a given value, which then forces C... this is multiple hops of logic. The more hops, the more difficult.

I didn't do it, but using the difficulty indicator, it would be possible to generate new Sudoku puzzles which involve a certain level of difficulty.

Reply With Quote
  #6  
Old October 24th, 2007, 10:20 AM
0CIRCLE0 0CIRCLE0 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 59 0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 18 h 48 m 59 sec
Reputation Power: 84
Quote:
Originally Posted by Dijkstra
Sorry, still off topic...

For Sudoku, I wrote a simple program that gave me an indication of how difficult it was to fill another square of a given puzzle correctly. e.g. if any column/row/box has an entry with a single possibility in relation to the rest of the column/row/box that that is defined as a "1 hop logic" (easy). But if I can fill entry A, which in turn forces another entry B to be a given value, which then forces C... this is multiple hops of logic. The more hops, the more difficult.

I didn't do it, but using the difficulty indicator, it would be possible to generate new Sudoku puzzles which involve a certain level of difficulty.


I was thinking of just throwing random numbers around using the algorithm until a solvable puzzle results and then use that.

Reply With Quote
  #7  
Old October 24th, 2007, 10:25 AM
Dijkstra Dijkstra is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Location: UK
Posts: 71 Dijkstra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 17 h 32 m 13 sec
Reputation Power: 1
Quote:
Originally Posted by 0CIRCLE0
I was thinking of just throwing random numbers around using the algorithm until a solvable puzzle results and then use that.


I guess you could, but I'm wondering how often you will get a challenging puzzle as opposed to an easy one?! I'm not sure. I suppose the initial amount of given numbers also affects the difficulty.

Reply With Quote
  #8  
Old October 24th, 2007, 06:48 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,430 Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 4 Weeks 1 Day 21 h 41 m 55 sec
Reputation Power: 784
IIRC, there used to be a demo chess program that came packaged along with Turbo C (or was it Turbo Pascal). Are you sure your seniors didn't just grab that code and present it as theirs.

By the way, writing a chess program is mainly about algorithms rather than language specific. I wrote one a long time ago myself in C. Specifically, the front end was written in C++ Builder with a GUI, but it could have been written for text mode as well, because all the front end did was draw the current representation of the board array on the screen and accept input to represent a move. The code could have easily been ported to a text-mode front end if needed. Had a few bugs (mainly, it would take one of its own pieces when it started), but it could beat me pretty handily.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month

Reply With Quote
  #9  
Old October 25th, 2007, 01:44 AM
0CIRCLE0 0CIRCLE0 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 59 0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level)0CIRCLE0 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 18 h 48 m 59 sec
Reputation Power: 84
Quote:
Originally Posted by Dijkstra
I guess you could, but I'm wondering how often you will get a challenging puzzle as opposed to an easy one?! I'm not sure. I suppose the initial amount of given numbers also affects the difficulty.


The difficulty of sudoku is from the amount of numbers you start with. From 8 being most difficult to 18 being easy if I got that right.

Reply With Quote
  #10  
Old October 25th, 2007, 05:00 AM
Dijkstra Dijkstra is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Location: UK
Posts: 71 Dijkstra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 17 h 32 m 13 sec
Reputation Power: 1
Quote:
Originally Posted by 0CIRCLE0
The difficulty of sudoku is from the amount of numbers you start with. From 8 being most difficult to 18 being easy if I got that right.


I don't agree.

From: http://en.wikipedia.org/wiki/Sudoku

"The difficulty of a puzzle is based on the relevance and the positioning of the given numbers rather than their quantity. Surprisingly, most of the time the number of givens does not reflect a puzzle's difficulty."

See also: http://sudokuplace.com/sudoku_scoring.asp

Reply With Quote
  #11  
Old October 25th, 2007, 01:34 PM
Yahweh Yahweh is offline
Vegan
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Posts: 213 Yahweh User rank is First Lieutenant (10000 - 20000 Reputation Level)Yahweh User rank is First Lieutenant (10000 - 20000 Reputation Level)Yahweh User rank is First Lieutenant (10000 - 20000 Reputation Level)Yahweh User rank is First Lieutenant (10000 - 20000 Reputation Level)Yahweh User rank is First Lieutenant (10000 - 20000 Reputation Level)Yahweh User rank is First Lieutenant (10000 - 20000 Reputation Level)Yahweh User rank is First Lieutenant (10000 - 20000 Reputation Level)Yahweh User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 20 h 22 m 20 sec
Reputation Power: 105
Quote:
Originally Posted by Untitled1234
I want a lot of help though!

1. Do i use a 2d ( 8*8 ) array to represent the board??
2. How do i give life to the pieces?
3. I am planning on using Linked lists to create hierarchical trees ( Cuz thats what my seniors used ) and i think there is no other alternative as far as TURBO C++ is concerned.... But then even though i know how to use linked list i don't know how to go about it in the chess program...
4. What kind of variables should i use?? and what are the variables for anyway??
5. I also heard about recursive loops, which i think is essential for a chess game!! But then i don't know anything about it!!
6. I would also need help on the evaluation process where the computer does the evaluation to choose the best move out of all the possible ones... How is it done???
7. Other than all this i would also need very little help in graphics and other stuff in which i represent the game ( The timer, The board, the pieces, The moves which i have to represent like e4 to e5 etc. etc. )

Forget it, buddy. If you don't know what a variable is, what a loop is, or what an array is, you cannot write this program.

If you want to read about how chess programs are programmed, read about it on Wikipedia.




Start with something simple, like a number guessing game. (The computer picks a random number between 1 and 100. Then users take turns trying to guess the number. The computer tells the user whether the guess is larger or smaller than the guess number.)

Then try making tic-tac-toe.

Then go for an othello-type game.

Then make a poker-type game.

After that, maybe you'll have the skills write a chess game.

If you try to write a chess program without mastering the basics, you're going to frustrate yourself and accomplish precisely nothing. You're not going to learn C++ that way either.

Last edited by Yahweh : October 25th, 2007 at 01:37 PM.

Reply With Quote
  #12  
Old December 8th, 2007, 09:17 AM
bstjean bstjean is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Montreal, Canada
Posts: 43 bstjean User rank is Corporal (100 - 500 Reputation Level)bstjean User rank is Corporal (100 - 500 Reputation Level)bstjean User rank is Corporal (100 - 500 Reputation Level)bstjean User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 14 h 42 m 25 sec
Reputation Power: 7
Send a message via Yahoo to bstjean
Quote:
Originally Posted by Untitled1234
Hey guys!!

I am Planning on Creating a Computer vs. User Chess game involving Artificial Intelligence... by just using TURBO C++

This is NOT impossible!! Please understand that my seniors achieved this last year and they had hardly a month's time to do it!!


A good starting point would be to look at the following ressources on the web:

http://en.wikipedia.org/wiki/Crafty
http://members.home.nl/matador/chess830.htm
rec.games.chess.computer

You'll be able to find tons of papers on the subject and if I recall, Arasan used to be in C++ and came with source code and explanation on design decisions (why this kind of structure, search algorithm, etc).

The rec.games.chess.computer newsgroup is especially helpful and friendly.

Hope this helps.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesGame Development > Complete Chess Game with just TURBO C++


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump