File:TUROCHAMP vs Glennie, 1952.gif

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

Original file (800 × 800 pixels, file size: 2.89 MB, MIME type: image/gif, looped, 61 frames, 1 min 32 s)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
Description
English: Chess game between TUROCHAMP (with its moves calculated by Alan Turing) and Alick Glennie in 1952. After 29 moves, TUROCHAMP is in a lost position and resigns.
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 the TUROCHAMP-Glennie game using python-chess and ImageMagick

import os
import chess.pgn
import chess.svg

pgn = open('glennie.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))

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

# Now you can create the GIF animation with:
# convert -delay 150 g_*.png -loop 0 g.gif

Here is the "glennie.pgn" input file required by the Python code above:

[Event "Friendly game"]
[Site "Manchester, England"]
[Date "1952.??.??"]
[Round "?"]
[White "TUROCHAMP"]
[Black "Alick Glennie"]
[Result "0-1"]
[ECO "C26"]
[PlyCount "58"]

1.e4 e5 2.Nc3 Nf6 3.d4 Bb4 4.Nf3 d6 5.Bd2 Nc6 6.d5 Nd4 7.h4 Bg4 8.a4 Nxf3+ 9.gxf3 Bh5 10.Bb5+ c6 11.dxc6 O-O 12.cxb7 Rb8 13.Ba6 Qa5 14.Qe2 Nd7 15.Rg1 Nc5 16.Rg5 Bg6 17.Bb5 Nxb7 18.O-O-O Nc5 19.Bc6 Rfc8 20.Bd5 Bxc3 21.Bxc3 Qxa4 22.Kd2 Ne6 23.Rg4 Nd4 24.Qd3 Nb5 25.Bb3 Qa6 26.Bc4 Bh5 27.Rg3 Qa4 28.Bxb5 Qxb5 29.Qxd6 Rd8 0-1

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:21, 14 December 2020Thumbnail for version as of 12:21, 14 December 2020800 × 800 (2.89 MB)Morn (talk | contribs)Uploaded own work with UploadWizard

File usage on other wikis

The following other wikis use this file: