2 # This file is part of LyX, the document processor.
3 # Licence details can be found in the file COPYING.
5 # author Kayvan A. Sylvan
7 # Full author contact details are available in file CREDITS.
9 # This script will convert a chess position in the FEN
10 # format to an ascii representation of the position.
12 from __future__ import print_function
17 sys.stdin = open(sys.argv[1],"r")
18 sys.stdout = open(sys.argv[2],"w")
20 line = sys.stdin.readline()
24 line=string.split(line,' ')[0]
25 comp=string.split(line,'/')
30 print (margin+' +'+"-"*15+'+')
35 if j>='0' and j <= '9':
36 for k in range(int(j)):
38 x, mod = divmod(cont,2)
39 if mod : tmp = tmp + '| '
40 else : tmp = tmp + '|*'
46 print (margin, row, tmp+"|")
48 print (margin+' +'+"-"*15+'+')
49 print (margin+' a b c d e f g h ')