Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

Chess

Symbols

  • Chessboard
  • ChessboardQ
  • ChessboardRecognize
  • ChessGame
  • ChessGameQ
  • ChessViewer
  • EngineEvaluate
  • Engine
  • QuitEngine
  • RandomChessboard
  • RandomChessGame
  • StartEngine

Formats

  • FEN
  • PGN
Wolfram`Chess`
ChessGame
​
ChessGame[
key
1

val
1
,…]
represents a chess game containing a sequence of moves and additional metadata.
​
Details and Options

Examples  
(8)
Basic Examples  
(1)
Import the first game stored in a PGN file as a
ChessGame
:
In[2]:=
game=Import["ExampleData/sample.pgn",{"ChessGames",1}]
Out[2]=
ChessGame
Fischer - Spassky
Date: 1992.11.04

Extract metadata from the game:
In[3]:=
game["Metadata"]//Dataset
Out[3]=
Black
Boris Spassky
Date
Wed 4 Nov 1992
Event
F/S Return Match
Result
1/2-1/2
Round
29
Site
Belgrade, Serbia JUG
White
Bobby Fischer
Dynamically view the game:
In[4]:=
ChessViewer[game]
Out[4]=
Bobby Fischer
–
Boris Spassky
F/S Return Match, round 29
Wed 4 Nov 1992, Belgrade, Serbia JUG
1/2-1/2
Wolfram`Chess`MLE`ChessBoard`NewBoard[rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1][Wolfram`Chess`MLE`ChessBoard`toGraphics[ImageSize250,Arrows{},
HighlightSquares{}]]
1.
e4
e5
2.
Nf3
Nc6
3.
Bb5
a6
4.
Ba4
Nf6
5.
O-O
Be7
6.
Re1
b5
7.
Bb3
d6
8.
c3
O-O
9.
h3
Nb8
10.
d4
Nbd7
11.
c4
c6
12.
cxb5
axb5
13.
Nc3
Bb7
14.
Bg5
b4
15.
Nb1
h6
16.
Bh4
c5
17.
dxe5
Nxe4
18.
Bxe7
Qxe7
19.
exd6
Qf6
20.
Nbd2
Nxd6
21.
Nc4
Nxc4
22.
Bxc4
Nb6
23.
Ne5
Rae8
24.
Bxf7+
Rxf7
25.
Nxf7
Rxe1+
26.
Qxe1
Kxf7
27.
Qe3
Qg5
28.
Qxg5
hxg5
29.
b3
Ke6
30.
a3
Kd6
31.
axb4
cxb4
32.
Ra5
Nd5
33.
f3
Bc8
34.
Kf2
Bf5
35.
Ra7
g6
36.
Ra6+
Kc5
37.
Ke1
Nf4
38.
g3
Nxh3
39.
Kd2
Kb5
40.
Rd6
Kc5
41.
Ra6
Nf2
42.
g4
Bd3
43.
Re6
Move 0 out of 43
≪
<
>
≫
Scope  
(6)

Properties & Relations  
(1)

SeeAlso
Chessboard
 
▪
ChessboardRecognize
Formats:
PGN
 
▪
FEN
""

© 2026 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com