Updating to version 1.3, release made by Mike Vanier (mvanier@bbb.caltech.edu).
[gnushogi.git] / doc / make_fig1
1 #! /usr/bin/env python
2
3 import sys, re
4
5 key = "The opening setup for shogi is as follows:"
6
7 replace = """
8 The opening setup for shogi is as follows:
9 <P>
10 <PRE>
11    9    8    7    6    5    4    3    2    1
12 +--------------------------------------------+     
13 | wL | wN | wS | wG | wK | wG | wS | wN | wL |  a     
14 +--------------------------------------------+       
15 |    | wR |    |    |    |    |    | wB |    |  b     
16 +--------------------------------------------+       
17 | wP | wP | wP | wP | wP | wP | wP | wP | wP |  c   
18 +--------------------------------------------+     
19 |    |    |    |    |    |    |    |    |    |  d   
20 +--------------------------------------------+     
21 |    |    |    |    |    |    |    |    |    |  e   
22 +--------------------------------------------+     
23 |    |    |    |    |    |    |    |    |    |  f   
24 +--------------------------------------------+     
25 | bP | bP | bP | bP | bP | bP | bP | bP | bP |  g   
26 +--------------------------------------------+       
27 |    | bB |    |    |    |    |    | bR |    |  h   
28 +--------------------------------------------+       
29 | bL | bN | bS | bG | bK | bG | bS | bN | bL |  i    
30 +--------------------------------------------+
31 </PRE>
32 """
33
34 #
35 # Insert the first figure directly into the html file.
36 #
37
38 done = 0
39
40 while 1:
41     line = sys.stdin.readline()
42     if not line:
43         break
44     
45     if not done:
46         match = re.match(key, line)
47         if match:
48             print replace,
49             done = 1
50         else:
51             print line,
52     else:
53         print line,
54
55