fen

Generate Chess Board Diagram from an array of positions in Python?

假如想象 提交于 2021-01-29 10:47:32
问题 I have an array which corresponds to the positions of pieces on a chessboard, like so: ['em', 'bn', 'em', 'wr', 'em', 'wp', 'em', 'em'] ['br', 'em', 'bp', 'em', 'em', 'bn', 'wn', 'em'] ['em', 'em', 'bp', 'bp', 'bp', 'em', 'wp', 'bp'] ['bp', 'bp', 'em', 'bp', 'wn', 'em', 'wp', 'em'] .... The 'b' and 'w' signify black and white. n: knight r: rook p: pawn b: bishop k: king q: queen I want to know if there exists some utility which can take this array or something similar and generate a picture