File:Einstein vs Oppenheimer.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.01 MB, MIME type: image/gif, looped, 50 frames, 1 min 15 s)

Summary

Description
English: Animation of chess game titled "Einstein versus Openneheimer" Princeton 1933.
Date
Source Own work
Author ReyHahn
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('einstein_oppenheimer.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 "Princeton USA"]
[Site "Princeton USA"]
[Date "1933.??.??"]
[EventDate "1933.??.??"]
[Round "?"]
[Result "1-0"]
[White "Albert Einstein"]
[Black "Robert Oppenheimer"]
[ECO "C70"]
[WhiteElo "?"]
[BlackElo "?"]
[PlyCount "47"]

1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 b5 5.Bb3 Nf6 6.O-O Nxe4 7.Re1
d5 8.a4 b4 9.d3 Nc5 10.Nxe5 Ne7 11.Qf3 f6 12.Qh5+ g6 13.Nxg6
hxg6 14.Qxh8 Nxb3 15.cxb3 Qd6 16.Bh6 Kd7 17.Bxf8 Bb7 18.Qg7
Re8 19.Nd2 c5 20.Rad1 a5 21.Nc4 dxc4 22.dxc4 Qxd1 23.Rxd1+ Kc8
24.Bxe7 1-0

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

Captions

Animation of chess game titled "Einstein versus Openneheimer" Princeton 19333

Items portrayed in this file

depicts

28 August 2023

image/gif

File history

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

Date/TimeThumbnailDimensionsUserComment
current17:22, 28 August 2023Thumbnail for version as of 17:22, 28 August 2023800 × 800 (2.01 MB)ReyHahnUploaded own work with UploadWizard
The following pages on the English Wikipedia use this file (pages on other projects are not listed):

Global file usage

The following other wikis use this file: