Jump to content

File:Immortal Zugzwang Game, 1923.gif

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

Original file (800 × 800 pixels, file size: 2.56 MB, MIME type: image/gif, looped, 53 frames, 1 min 20 s)

Summary

Description
English: Animation of the Immortal Zugzwang Game
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('saemisch_nimzowitsch_1923.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

[Event "Copenhagen"]
[Site "Copenhagen DEN"]
[Date "1923.03.09"]
[Round "6"]
[White "Friedrich Saemisch"]
[Black "Aron Nimzowitsch"]
[Result "0-1"]
[ECO "E18"]
[EventDate "1923.03.03"]
[PlyCount "50"]

1.d4 Nf6 2.c4 e6 3.Nf3 b6 4.g3 Bb7 5.Bg2 Be7 6.Nc3 O-O 7.O-O d5 8.Ne5 c6 9.cxd5 cxd5 10.Bf4 a6 11.Rc1 b5 12.Qb3 Nc6 13.Nxc6 Bxc6 14.h3 Qd7 15.Kh2 Nh5 16.Bd2 f5 17.Qd1 b4 18.Nb1 Bb5 19.Rg1 Bd6 20.e4 fxe4 21.Qxh5 Rxf2 22.Qg5 Raf8 23.Kh1 R8f5 24.Qe3 Bd3 25.Rce1 h6 0-1

Licensing

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.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

16 December 2020

image/gif

2,683,817 byte

79.5 second

800 pixel

800 pixel

2fc7d1fba91423e4f42e6420ffe89d46ffd33336

File history

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

Date/TimeThumbnailDimensionsUserComment
current12:48, 16 December 2020Thumbnail for version as of 12:48, 16 December 2020800 × 800 (2.56 MB)MornUploaded own work with UploadWizard

The following page uses this file:

Global file usage

The following other wikis use this file: