% ranks = "87654321" % #ranks = ranks if game.turn=="white" else ranks[::-1] % files = "abcdefgh" % is_black = lambda x: (ord(x[0])-ord('a')) % 2 != int(x[1]) % 2 % for i, rank in enumerate(ranks): % for file in files: % sq = file + rank % color = 'bgcolor=silver' if is_black(sq) else "" % widths = i==0, file=='h', i==7, file=='a' % widths = "pt ".join(map(str, map(int, widths))) + "pt" % end % end % for file in files: % end
{{rank}}{{game.board[sq]}}
{{file}}
% first = "disabled" if game.index < 2 else "" % prev = "disabled" if game.index == 0 else "" % next = "disabled" if game.index+1 == len(game.history) else "" % last = "disabled" if game.index+2 >= len(game.history) else "" "}}" {{next}}> >"}}" {{last}}>
% if not game.endofgame(): % end