4 # This file is part of LyX, the document processor.
5 # Licence details can be found in the file COPYING.
7 # author Kayvan A. Sylvan
9 # Full author contact details are available in file CREDITS.
11 # This script will convert a chess position in the FEN
12 # format to an ascii representation of the position.
18 sys.stdin = open(sys.argv[1],"r")
19 sys.stdout = open(sys.argv[2],"w")
21 line = sys.stdin.readline()
25 line=string.split(line,' ')[0]
26 comp=string.split(line,'/')
31 print margin+' +'+"-"*15+'+'
37 if j>='0' and j <= '9':
38 for k in range(int(j)):
40 x, mod = divmod(cont,2)
41 if mod : tmp = tmp + '| '
42 else : tmp = tmp + '|*'
48 print margin, row, tmp+"|"
50 print margin+' +'+"-"*15+'+'
51 print margin+' a b c d e f g h '