#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2007
    Posts
    2
    Rep 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
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 2006
    Posts
    2,270
    Rep Power
    1736
    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.
    When you ask a question, be prepared to tell us: what have you tried? If you think you don't need to try anything, we will never be interested in helping you. If you agree with the link, and you refuse to answer that question, you are being a hypocrite.

    Need help with broken code? Your question should be like a good bug report: (1) It has the smallest number of steps to reproduce the problem you see (2) It tells us precisely what you expected to see and (3) It tells us what you saw and how it differed from what you expected. We need all three to help you.
    Want better answers? Tell us what you Googled for and what steps you took to answer your own question.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2007
    Posts
    65
    Rep Power
    90
    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.

    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.)
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2007
    Posts
    65
    Rep Power
    90
    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;
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2007
    Location
    UK
    Posts
    153
    Rep Power
    98
    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.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2007
    Posts
    65
    Rep Power
    90
    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.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2007
    Location
    UK
    Posts
    153
    Rep Power
    98
    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.
  14. #8
  15. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,595
    Rep Power
    4207
    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

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2007
    Posts
    65
    Rep Power
    90
    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.
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2007
    Location
    UK
    Posts
    153
    Rep Power
    98
    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
  20. #11
  21. No Profile Picture
    Vegan
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2007
    Posts
    213
    Rep Power
    110
    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.
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Location
    Montreal, Canada
    Posts
    43
    Rep Power
    13
    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.

IMN logo majestic logo threadwatch logo seochat tools logo