Initial commit
[trapthecap.git] / src / html-files / .svn / text-base / interface.html.svn-base
1 <html>
2 <head>
3 <title>Trap the Cap Interface</title>
4 </head>
5 <body>
6
7 <h1><a href="index.html">Trap the Cap</a> Computer Interface</h1>
8
9 <h2>Changes</h2>
10 <table cellpadding="3">
11
12 <tr valign="top">
13 <td>23 February 2009</td>
14 <td>Fixed the sample game file to a legal one.</tr>
15
16 <tr valign="top">
17 <td>7 September 2007</td>
18 <td>Updated library: now prevents moves via base without captured pieces and prevents more than three pieces on a safe position.<br>
19 Changed format for moves that end on a base</td>
20 </tr>
21
22 <tr valign="top">
23 <td>31 August 2007</td>
24 <td>Changed example input file (old one was invalid)<br>
25 Added notation for moves via bases<br>
26 Changed time limit to 10 seconds</td>
27 </tr>
28 </table>
29
30 <p>The game will be played between two and six players. See below for
31 the identities of the players.</p>
32
33 <table>
34 <tr><th>No. of players</th><th>Players</th</tr>
35 <tr align=center><td>2</td><td>A, D</td></tr>
36 <tr align=center><td>3</td><td>A, C, E</td></tr>
37 <tr align=center><td>4</td><td>A, B, D, E</td></tr>
38 <tr align=center><td>5</td><td>A, B, C, D, E</td></tr>
39 <tr align=center><td>6</td><td>A, B, C, D, E, F</td></tr>
40 </table>
41
42 <p>Your program will be run afresh for each move it has to make. Your
43 program will be fed the history of the game so far on standard input.
44 It will then have 10 seconds to report its move on standard
45 output.</p>
46
47 <p>The format of the input is as follows. The first line will be a
48 single digit, giving the number of players. Subsequent lines will
49 give the moves played so far in the game. The final line will be the
50 dice roll for your move. Each move will be in the format <br>
51 <code>&lt;piece moved&gt; &lt;location moved to&gt;</code><br>
52
53 (that's a single space between the two parts of the line). If a move
54 is via a base, the move will be in the format <br>
55 <code>&lt;piece moved&gt; &lt;base moved via&gt; &lt;location moved
56 to&gt;</code><br>
57 If a move is to a base, the move notation may be in either form.</p>
58
59 <p>It may be that one player may have many consecutive moves if they
60 roll multiple sixes. There are no additional spaces or blank lines in
61 the file.</p>
62
63 <p>Here is an example of a valid input file:</p>
64
65 <pre>3
66 A1 AC2
67 C4 B5
68 E1 EC5
69 E2 E3
70 A1 EC5
71 C4 B2
72 4</pre>
73
74 <p>(Note the caputre of piece E1 by piece A1 on position EC5.)
75
76 <p>Player program will run on a Linux machine (probably some version
77 of Ubuntu Linux). Exact specification is unclear at the moment, but
78 it may run on a twin-processor machine.</p>
79
80 <p>The player's program must be named <code>runme</code>; it may be a
81 binary executable or a driver shell script that starts up the actual
82 program. It will be invoked as<br>
83
84 <pre> ./runme</pre><br>
85
86 with the program's top-level directory as the current working
87 directory; libraries and other support data may thus be accessed with
88 the relative path name <br>
89
90 <pre> support/...</pre></p>
91
92 <p>The program is run once for every move and then terminates; the
93 current move state will be passed to the program on standard
94 input. Persistent inter-move state may be kept in the
95 <code>support/</code> directory if desired. When the program has
96 chosen a move, it should print the move to standard output and
97 exit. If the program has not done so after 10 seconds (real or "wall
98 clock" time), the program will be terminated forcibly, and lose the
99 game. </p>
100
101 <p>There should be no child processes alive after the top-level
102 process exits; the program must ensure that all its child processes
103 have exited before the top-level process exits itself.</p>
104
105 </body>
106 </html>