Brugernavn: Kodeord:
Ny bruger registrering
Moderator: Walter Montego 
 Chess variants (10x8)

Sam has closed his piano and gone to bed ... now we can talk about the real stuff of life ... love, liberty and games such as
Janus, Capablanca Random, Embassy Chess & the odd mention of other 10x8 variants is welcome too


For posting:
- invitations to games (you can also use the New Game menu or for particular games: Janus; Capablanca Random; or Embassy)
- information about upcoming tournaments
- disussion of games (please limit this to completed games or discussion on how a game has arrived at a certain position
... speculation on who has an advantage or the benefits of potential moves is not permitted while that particular game is in progress)
- links to interesting related sites (non-promotional)


Liste over diskussionsborde
Tilstand: Alle kan skrive
Søg i meddelelser:  

26. Marts 2003, 16:14:56
Grim Reaper 
Emne: Re: How a Database Wins
Felixe mentioned:

"I would like to know, how can you be sure that a program can find all the best moves for the defensive king?"

The database starts by placing the pieces on every square and asking the simple question: Is the side to move in checkmate? Yes, identify this as a loss in 0. No? Is the side to move in stalemate? Yes? Identify this position as a draw. No? Can the side to move win one piece? Yes? identify this position as a draw. No? There is not enough informaiton to resolve the position yet, keep looping.

Eventually, it finishes "pass #1" and has identified all of the losses and draws. Then, by definition, every position on subsequent passes must be either play into: a pre-resolved win, a pre-resolved loss, a pre-resolved draw, or remain undetermined.

In order to resolve a win, only one move for the winning side need to lead to a win. In order to resolve a loss, EVERY move for the losing side must lead to a win for the other side.

As you loop around, doing pass after pass, you have a variable that indicated whether or not you resolved something on a particular pass. After so many loops, there may be nothing left to resolve. By definition, any of the UNKNOWN positions must be draws, so you mark them as draws then you are done.

Why you consult the database in a position, here is what you do:

1. Determine if you are in a win, loss, or draw to start. This is stored in the db.

2. Generate all legal moves from the position.

3. If in a win, look up the # of moves to lose for the other side to move. Pick the smallest number you find, and make the move leading to that position.

4. If in a loss, look up the # of moves to win for the other side to move. Pick the largest number you find, and make the move leading to that position.

5. If in a draw, make sure you do not move into a loss! (It is impossible to select a move leading to a win, or it would not be a draw.)

In this fashion, the program can always play the best defensive move for the weak side, and fastest winning move for the strong side.

Dato og klokkeslæt
Venner online
Favoritborde
Sammenslutninger
Dagens tip
Copyright © 2002 - 2024 Filip Rachunek, all rights reserved.
Tilbage til toppen