3 # Copyright (C) 2001 The LyX Team.
5 # This file is distributed under the GPL license.
7 # This script will convert a chess position in the FEN
8 # format to an ascii representation of the position.
15 sys.stdin = open(sys.argv[1],"r")
16 sys.stdout = open(sys.argv[2],"w")
18 line = sys.stdin.readline()
22 line=string.split(line,' ')[0]
23 comp=string.split(line,'/')
28 print margin+' +'+"-"*15+'+'
34 if j>='0' and j <= '9':
35 for k in range(int(j)):
37 x, mod = divmod(cont,2)
38 if mod : tmp = tmp + '| '
39 else : tmp = tmp + '|*'
45 print margin, row, tmp+"|"
47 print margin+' +'+"-"*15+'+'
48 print margin+' a b c d e f g h '