File:Botvinnik vs Sargon, 1983.gif

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(800 × 800 pixels, file size: 3.37 MB, MIME type: image/gif, looped, 76 frames, 1 min 54 s)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: Botvinnik vs Sargon chess game animation
Date
Source Own work
Author Morn
GIF development
InfoField
 
This GIF graphic was created with Python.
Source code
InfoField

Python code

Source code
#!/usr/bin/env python3

# Plot a PGN game using python-chess and ImageMagick

import os
import chess.pgn
import chess.svg

pgn = open('botvinnik_sargon_1983.pgn')
game = chess.pgn.read_game(pgn)
board = game.board()

def svg(i):
    lm = board.peek()
    a = [(lm.from_square, lm.to_square)]
    s = chess.svg.board(board, arrows = a, size = 800)

    f1 = "g_%04u.svg" % i
    f2 = "g_%04u.png" % i

    with open(f1, 'w') as f:
        f.write(s)
    os.system("convert %s %s" % (f1, f2))
    os.system("rm %s" % f1)

i = 1

for m in game.mainline_moves():
    board.push(m)
    svg(i)
    i += 1

# pause animation at the end:
for j in range(3):
    svg(i)
    i += 1

# create animation with
# convert -delay 150 g_*.png -loop 0 g.gif

PGN[edit]

[Event "Hamburg"]
[Site "Hamburg"]
[Date "1983.??.??"]
[EventDate "?"]
[Round "?"]
[Result "1-0"]
[White "Mikhail Botvinnik"]
[Black "Sargon (Computer)"]
[ECO "A21"]
[PlyCount "73"]

1.c4 e5 2.Nc3 d6 3.g3 Be6 4.Bg2 Nc6 5.d3 Nf6 6.f4 Be7 7.Nf3
O-O 8.O-O Qd7 9.e4 Bg4 10.h3 Bxh3 11.f5 Bxg2 12.Kxg2 Nb4 13.a3
Na6 14.b4 c5 15.b5 Nc7 16.Rh1 a6 17.b6 Nce8 18.Ng5 Qc6 19.Rb1
Bd8 20.Nd5 h6 21.Nf3 Nxd5 22.exd5 Qd7 23.g4 a5 24.Nd2 Ra6
25.Ne4 Rxb6 26.Rxb6 Bxb6 27.f6 Nxf6 28.Nxf6+ gxf6 29.Bxh6 Re8
30.Qf3 Bd8 31.Qh3 Qa4 32.Bd2 Kf8 33.Rf1 Kg8 34.Qh6 Qd7 35.Kg3
f5 36.Rh1 f4 37.Kf3 1-0

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current12:28, 10 November 2021Thumbnail for version as of 12:28, 10 November 2021800 × 800 (3.37 MB)Morn (talk | contribs)Uploaded own work with UploadWizard

File usage on other wikis

The following other wikis use this file: