File:Immortal Losing Game, 1957.gif

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

Original file(800 × 800 pixels, file size: 2.86 MB, MIME type: image/gif, looped, 60 frames, 1 min 30 s)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: Animation of the 1957 Immortal Losing Game between David Bronstein and the Polish International Master Bogdan Śliwa
Date
Source Own work
Author Morn
GIF development
InfoField
Python-logo-notext 
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('sliwa_bronstein_1957.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 "Gotha"]
[Site "Gotha GDR"]
[Date "1957.09.??"]
[EventDate "?"]
[Round "4"]
[Result "1-0"]
[White "Bogdan Sliwa"]
[Black "David Bronstein"]
[ECO "A81"]
[WhiteElo "?"]
[BlackElo "?"]
[PlyCount "57"]

1. d4 f5 2. g3 g6 3. Bg2 Bg7 4. Nc3 Nf6 5. Bg5 Nc6 6. Qd2 d6
7. h4 e6 8. O-O-O h6 9. Bf4 Bd7 10. e4 fxe4 11. Nxe4 Nd5
12. Ne2 Qe7 13. c4 Nb6 14. c5 dxc5 15. Bxc7 O-O 16. Bd6 Qf7
17. Bxf8 Rxf8 18. dxc5 Nd5 19. f4 Rd8 20. N2c3 Ndb4 21. Nd6
Qf8 22. Nxb7 Nd4 23. Nxd8 Bb5 24. Nxe6 Bd3 25. Bd5 Qf5
26. Nxd4+ Qxd5 27. Nc2 Bxc3 28. bxc3 Qxa2 29. cxb4 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
current14:50, 20 December 2020Thumbnail for version as of 14:50, 20 December 2020800 × 800 (2.86 MB)Morn (talk | contribs)Uploaded own work with UploadWizard

File usage on other wikis

The following other wikis use this file: