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.
#!/usr/bin/env python3# Plot the TUROCHAMP-Glennie game using python-chess and ImageMagickimportosimportchess.pgnimportchess.svgpgn=open('glennie.pgn')game=chess.pgn.read_game(pgn)board=game.board()defsvg(i):lm=board.peek()a=[(lm.from_square,lm.to_square)]s=chess.svg.board(board,arrows=a,size=800)f1="g_%04u.svg"%if2="g_%04u.png"%iwithopen(f1,'w')asf:f.write(s)os.system("convert %s%s"%(f1,f2))i=1formingame.mainline_moves():board.push(m)svg(i)i+=1# pause animation at the end:forjinrange(3):svg(i)i+=1# Now you can create the GIF animation with:# convert -delay 150 g_*.png -loop 0 g.gif