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.
16 sys.stdin = open(sys.argv[1],"r")
17 sys.stdout = open(sys.argv[2],"w")
19 line = sys.stdin.readline()
23 line=string.split(line,' ')[0]
24 comp=string.split(line,'/')
29 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 '