-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
42 lines (36 loc) · 1.43 KB
/
main.py
File metadata and controls
42 lines (36 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from pgn_utils import load_pgn
from eco_utils import load_eco_database
from stockfish_utils import connect_stockfish, disconnect_stockfish
from basic_analysis import analyze_game
from fork_analysis import analyze_forks
from check_analysis import analyze_checks
from en_passant import count_en_passant_moves
from threat_analysis import analyze_game_material_threats
from zugzwang_analysis import find_zugzwang_positions
def main():
pgn_file = "PgnFiles/Zugzwang/Friedrich Säemisch _vs_Aron Nimzowitsch_1923.__.__.pgn"
stockfish_path = "stockfish.exe"
eco_directory = "OpeningCodes/tsv"
# ECO veritabanını yükle
eco_database = load_eco_database(eco_directory)
# PGN dosyasını yükle
game = load_pgn(pgn_file)
# Stockfish'e bağlan
engine = connect_stockfish(stockfish_path)
# Maçı analiz et
results = analyze_game(game, engine, eco_database)
# fork_results = analyze_forks(game)
# results.update(fork_results)
check_results = analyze_checks(game)
results.update(check_results )
en_passant_stats = count_en_passant_moves(game)
results.update(en_passant_stats)
# threats = analyze_game_material_threats(game,stockfish_path)
# results.update(threats)
zugzwangs = find_zugzwang_positions(pgn_file,stockfish_path)
results.update(zugzwangs)
print(results)
# Stockfish bağlantısını kapat
disconnect_stockfish(engine)
if __name__ == "__main__":
main()