Jump to content

File:McDonnell vs De La Bourdonnais, 1834.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: 3.37 MB, MIME type: image/gif, looped, 77 frames, 1 min 56 s)

Summary

Description
English: Animation of the McDonnell versus De La Bourdonnais chess 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('mcdonnell_la_bourdonnais_1834.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 "London m4 ;HCL 18"]
[Site "London ENG"]
[Date "1834.??.??"]
[EventDate "?"]
[Round "?"]
[Result "0-1"]
[White "Alexander McDonnell"]
[Black "Louis Charles Mahe De La Bourdonnais"]
[ECO "B32"]
[WhiteElo "?"]
[BlackElo "?"]
[PlyCount "74"]

1.e4 c5 2.Nf3 Nc6 3.d4 cxd4 4.Nxd4 e5 5.Nxc6 bxc6 6.Bc4 Nf6
7.Bg5 Be7 8.Qe2 d5 9.Bxf6 Bxf6 10.Bb3 O-O 11.O-O a5 12.exd5
cxd5 13.Rd1 d4 14.c4 Qb6 15.Bc2 Bb7 16.Nd2 Rae8 17.Ne4 Bd8
18.c5 Qc6 19.f3 Be7 20.Rac1 f5 21.Qc4+ Kh8 22.Ba4 Qh6 23.Bxe8
fxe4 24.c6 exf3 25.Rc2 Qe3+ 26.Kh1 Bc8 27.Bd7 f2 28.Rf1 d3
29.Rc3 Bxd7 30.cxd7 e4 31.Qc8 Bd8 32.Qc4 Qe1 33.Rc1 d2 34.Qc5
Rg8 35.Rd1 e3 36.Qc3 Qxd1 37.Rxd1 e2 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

Animation of the McDonnell versus De La Bourdonnais chess game

Items portrayed in this file

depicts

20 December 2020

File history

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

Date/TimeThumbnailDimensionsUserComment
current15:46, 20 December 2020Thumbnail for version as of 15:46, 20 December 2020800 × 800 (3.37 MB)MornUploaded own work with UploadWizard

The following page uses this file:

Global file usage

The following other wikis use this file: