Shatranj is 'n bitboard gebaseer is, Open-Source, interaktiewe skaak programme module wat manipulasie van skaak posisies en eksperimentering kan met 'n soektog algoritmes en evaluering tegnieke. Doel Shatranj is om 'n toolkit om te help met die implementering van Shannon Tipe B skaak programme te skryf.
As sodanig, uitvoering spoed word minder belangrik dan code duidelikheid en ekspressiewe krag van die taal implementering. Met 'n geïnterpreteer taal geskryf is, is hierdie module laat die skaak programmeerder om bitboards manipuleer in 'n natuurlike, interaktiewe manier baie soos seinverwerking hulpmiddels toelaat kommunikasie ingenieurs vektore van klanke monsters manipuleer in MATLAB.
Die module currenly implementeer 'n eenvoudige rekursiewe minimaks soek met alphabeta snoei, iteratiewe verdieping, gebruik kort algebraïese notasie, hanteer herhaling tjek, en die 50 skuif reël. Funksies ontbreek is statiese tjeks, oorgang tafels, negascout en MTD soek.
Die skaak programme toolkit is beskikbaar in die vorm van 'n Python module genoem shatranj.py. Jy sal waarskynlik ook nodig die opening boek asook 'n paar van die pre-gebou hash tabelle wat gebruik word deur die module (dit sal herbereken indien die module die data lêer nie kan vind).
Plaas al drie lêer in dieselfde gids en eenvoudig hardloop luislang op die luislang module ("python shatranj.py"). Sover vereistes, al wat nodig is, is 'n onlangse weergawe van die geïnterpreteerde, hoëvlak taal genoem Python (enigiets na weergawe 2.3 moet werk boete). As jy wil graag 'n bietjie van 'n spoed hupstoot, shatranj lyk vir die module Psyco en sal dit gebruik as dit geïnstalleer is.
Totdat daar meer dokumentasie beskikbaar, hier is 'n kort voorbeeld sessie:
[Sam-Tannous Rekenaar: ~ / shatranj] stannous% python
>>> Van shatranj invoer *
... Lees startup data
... Totale tyd vir data ,0774528980255 gelees
... Gevind opening boek shatranj-book.bin met 37.848 posisies
>>> Posisie = Posisie ("r1bqk2r / pppp1ppp / 2n5 / 5N2 / 2B1n3 / 8 / PPP1QPPP / R1B1K2R")
>>> All_pieces = position.piece_bb ["b_occupied"] | position.piece_bb ["w_occupied"]
>>> Other_pieces = position.piece_bb ["b_occupied"]
>>> From_square = c4
>>> WTM = 1
>>> Masker = position.pinned (from_square, WTM)
>>> Ne_pieces = diag_mask_ne [from_square] & all_pieces
>>> Nw_pieces = diag_mask_nw [from_square] & all_pieces
>>> Beweeg = ((diag_attacks_ne [from_square] [ne_pieces] & other_pieces) |
... (Diag_attacks_ne [from_square] [ne_pieces] & ~ all_pieces) |
... (Diag_attacks_nw [from_square] [nw_pieces] & other_pieces) |
... (Diag_attacks_nw [from_square] [nw_pieces] & ~ all_pieces)) & masker
>>>
>>> Beweeg
1275777090846720L
>>>
>>> Tobase (beweeg, 2)
'100100010000101000000000000010100000000000000000000'
>>> Vertoon (beweeg)
+ --- + --- + --- + --- + --- + --- + --- + --- +
8 | |. | |. | |. | |. |
+ --- + --- + --- + --- + --- + --- + --- + --- +
7 |. | |. | |. | 1 |. | |
+ --- + --- + --- + --- + --- + --- + --- + --- +
6 | 1 |. | |. | 1 |. | |. |
+ --- + --- + --- + --- + --- + --- + --- + --- +
5 |. | 1 |. | 1 |. | |. | |
+ --- + --- + --- + --- + --- + --- + --- + --- +
4 | |. | |. | |. | |. |
+ --- + --- + --- + --- + --- + --- + --- + --- +
3 |. | 1 |. | 1 |. | |. | |
+ --- + --- + --- + --- + --- + --- + --- + --- +
2 | |. | |. | |. | |. |
+ --- + --- + --- + --- + --- + --- + --- + --- +
1 |. | |. | |. | |. | |
+ --- + --- + --- + --- + --- + --- + --- + --- +
'n b c d e f g h
>>> Position.show_moves (1)
['Rg1 "," O-O "," f3', 'a3', 'Rb1', 'f4', 'Ba6,
'Bh6', 'Bd3', 'Qg4 "," QE3 "," Ne7', 'Be6', 'Nxg7,
'QXE4', 'Ne3', 'b4', 'NH4', 'b3', 'uur3', 'Bg5,
'G3 "," Kf1', 'RF1', 'Nh6', 'n A4 "," Ng3 ',' Qh5,
'Kd1', 'h4', 'h3', 'c3', 'Bxf7', 'Nd6', 'BB5,
'Nd4', 'Qf3 "," G4', 'Qf1', 'BB3', 'Qd1', 'Qd3,
'Qd2', 'Bd5', 'BD2', 'Bf4']
>>>
>>> # Nou speel 'n spel!
>>> Speel ()
Shatranj weergawe 1,10
g: skakelaar kante m: wys reg beweeg
N: nuwe spel l: Lys spel rekord
d: bord b: wys boek beweeg
sd: verandering search diepte (2-16) verstek = 5
q: stop
Shatranj: d
+ --- + --- + --- + --- + --- + --- + --- + --- +
8 | r | N | B | V | K | b | N | r |
+ --- + --- + --- + --- + --- + --- + --- + --- +
7 | p | p | p | p | p | p | p | p |
+ --- + --- + --- + --- + --- + --- + --- + --- +
6 | |. | |. | |. | |. |
+ --- + --- + --- + --- + --- + --- + --- + --- +
5 |. | |. | |. | |. | |
+ --- + --- + --- + --- + --- + --- + --- + --- +
4 | |. | |. | |. | |. |
+ --- + --- + --- + --- + --- + --- + --- + --- +
3 |. | |. | |. | |. | |
+ --- + --- + --- + --- + --- + --- + --- + --- +
2 | P | P | P | P | P | P | P | P |
+ --- + --- + --- + --- + --- + --- + --- + --- +
1 | R | N | B | Q | K | B | N | R |
+ --- + --- + --- + --- + --- + --- + --- + --- +
'n b c d e f g h
Sagteware besonderhede:
Weergawe: 1.17
Upload datum: 3 Jun 15
Lisensie: Gratis
Populariteit: 94
Kommentaar nie gevind