Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Predstavitev potez: Razlika med redakcijama


 
(7 vmesnih redakcij 2 uporabnikov ni prikazanih)
Vrstica 1: Vrstica 1:
The representation of a chess game includes representation of positions and moves. Positions represent states of game and moves represent operators which are used to achieve transition from one position to another. Both of these representations must be able to do the following operations:
+
Poteze izvajamo in jih shranjujemo za kasnejšo uporabo znotraj iskalnih algoritmov. Zato predstavitev potez mora biti kompaktna in jedrnata. Možna predstavitve poteze je s pomočjo 16 bitnih števili in naslednjimi bitnimi maskami:
  
* make move
+
0000000000111111 - polja s katerega figuro premikamo<br>
* unmake move
+
0000001111000000 - figura promocije (opcijsko)<br>
* generate a list of all possible moves
+
1111110000000000 - polja na katero figuro premikamo<br>
* generate a list of all possible capture moves
 
* evaluate a position
 
* store moves
 
* compare positions
 
* set position
 
* check if position has been repeated 3 times
 
* check rule of 50 moves
 
* check if king is in check
 
  
All of these operations must be very time efficient because they take place inside the search algorithm. Efficient presentation of game will therefore exhibit an efficient chess program.
+
Prvih šest bitov se uporablja za opis polja s katerega premikamo figuro, naslednjih štiri bite za figuro promocije in zadnjih šest bitov za polje na katerega figuro premikamo. Figura promocije je opcijska.
 
 
The move is represented by a 16-bit integer value with following bit mask.
 
 
 
0000000000111111 - index of square from<br>
 
0000001111000000 - promotion piece (optionally)<br>
 
1111110000000000 - index of square to<br>
 
 
 
First six bits are used for the description of source square, next four for promotion piece type and last six for destination square. Promotion piece type is optionaly.
 
  
 
[[Category:Borko Bošković]]
 
[[Category:Borko Bošković]]
 +
[[Category:Raziskovalna dejavnost]]
 
[[Category:Šahovski program BBChess]]
 
[[Category:Šahovski program BBChess]]
 +
[[Category:Predstavitev šahovske igre]]
  
 
[[en:Move representation]]
 
[[en:Move representation]]

Trenutna redakcija s časom 11:56, 20. oktober 2006

Poteze izvajamo in jih shranjujemo za kasnejšo uporabo znotraj iskalnih algoritmov. Zato predstavitev potez mora biti kompaktna in jedrnata. Možna predstavitve poteze je s pomočjo 16 bitnih števili in naslednjimi bitnimi maskami:

0000000000111111 - polja s katerega figuro premikamo
0000001111000000 - figura promocije (opcijsko)
1111110000000000 - polja na katero figuro premikamo

Prvih šest bitov se uporablja za opis polja s katerega premikamo figuro, naslednjih štiri bite za figuro promocije in zadnjih šest bitov za polje na katerega figuro premikamo. Figura promocije je opcijska.