How does a computer play chess?

Discussion in 'Computer Science & Culture' started by dsdsds, May 5, 2003.

Thread Status:
Not open for further replies.
  1. dsdsds Valued Senior Member

    Messages:
    1,678
    How does a computer play chess? It is easy to program the chess pieces and the rules on how they are allowed to move on the board. But what algorithms are involved in decision of a move?
    How does it analyze every possible next move and series of moves from its opponent and every possible consequence of it’s own moves? How are any “strategies” programmed?
    Oh yeah, one last question. Do you have to be a good (or any) chess player to develop a chess program? I don’t see why.
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. grimreaper Registered Senior Member

    Messages:
    156
    simple stratagi

    each peice has a value.
    total of peices = power
    computer makes all possible moves and equates power for each move and places them in an aray then sorts to find move that loses least power.

    Please Register or Log in to view the hidden image!


    with respect
    grimreaper
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
  5. BloodSuckingGerbile Master of Puppets Registered Senior Member

    Messages:
    440
  6. Google AdSense Guest Advertisement



    to hide all adverts.
  7. SG-N Registered Senior Member

    Messages:
    1,051
    Grimreaper explained the main base : each piece has a value. Then you have to choose a function to calculate the "power" of your game : 4 points if a piece is ready to take the king, 3 points for the queen, -1 if one of my simple piece can be taken... Now that you have your actual power, you calculate each possibility when you'll move one piece (level 1). You calculate each "power" for each adversary-move that would be possible after each possibility of level 1 (level 2). And so on... You make a "tree".
    The problem is for CPU/Memory if you want to calculate more than 3 or 4 levels !

    A strategie is a suite of moves that has been decided following the pieces placed on the board. I already explained that the computer was using a tree to study the next possibilities, but I think that we can add some rules that could be used when the pieces are in a defined position on the board. In those cases, that would increase the power of one (or more) branch(s) of the tree.

    For a good chess program you need to have a good function for your heuristics. Being a good player will help for the creation of that function and for the definition of the strategies.
     
  8. SG-N Registered Senior Member

    Messages:
    1,051
  9. dsdsds Valued Senior Member

    Messages:
    1,678
    Thanks for the info. Very interesting!
     
Thread Status:
Not open for further replies.

Share This Page