CS 4500 Assignment #4. Assigned: Tuesday, 4 February 2014 Due: Tuesday, 11 February 2014 Working in an instructor-approved team of four students (except for a few smaller teams approved by the instructor), develop a rapid prototype of the greatly simplified version of the semester project specified below. Your prototype's source code must be written entirely by your team. Your team may not use source code written by other students, source code obtained from the World-Wide Web or other sources, and it may not use software packages that are not already installed on the CCIS Linux machines. In exceptional circumstances, you may ask the instructor for permission to use third party source code. You should not assume that permission will be granted. Your prototype must include a README file (which *must* be in UTF-8 plain text, and must be named README) that 1. lists all members of your team, 2. gives the preferred email address(es) for contacting your team, 3. tells the grader(s) how your team's rapid prototype can be compiled and run on any CCIS Linux machine in the main lab, 4. acknowledges any third party software used (by permission!) in your submitted software. All of the files necessary to construct and to run your prototype must be combined into a gzip'ed tar file whose name ends in tar.gz. Submit that gzip'ed tar file before 10pm on the date it is due using the submit script that's described at the course assignments page: http://www.ccs.neu.edu/course/cs4500sp14/assignments.html Your prototype will be graded on these criteria: 1. the quality of the instructions and documentation in your README file, 2. the ease of constructing and running your prototype on CCIS Linux machines, 3. your prototype's correctness with respect to parsing correct command lines sending correct messages not sending extraneous messages not sending messages too early not attempting to create files 4. and the readability of your source code. Your prototype's build process must result in software that can be invoked by cd'ing to the directory containing your software's executable and executing a command of the following form: ./play4500 --go --time/move where is 1 or 2, depending on whether the player goes first or second (respectively), and is the time allowed per move, in any of these formats: 2s 2.0s 2000ms 2000.0ms Example: ./play4500 --go 1 --time/move 1.2s says the player goes first and will be given 1.2 seconds per move. If the command line is incorrect, the play4500 program should write an appropriate error message to standard error and should then terminate with an exit code other than zero. If the command line is correct, then the play4500 program should send an initial configuration for its pieces to standard output. After sending that initial configuration to standard output, the play4500 program's behavior depends on whether it goes first or second. If the command line says the play4500 program is to go first, then the play4500 program should send its first move to standard output, and should then terminate with an exit code of zero. If the command line says the play4500 program is to go second, then the play4500 program should terminate with an exit code of zero without sending any more messages. A rapid prototype of the referee program will be placed within /course/cs4500sp14/Assignments/A4 ---------------------------------------------------------------- Format of messages. The message that conveys the initial configuration must have the following context-free syntax: ::= ( ) ::= | ::= ( ) ::= A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | B1 | B2 | B3 | B4 | B5 | B6 | B7 | B8 | B9 | B10 | B11 | B12 | C1 | C2 | C3 | C4 | C5 | C6 | C7 | C8 | C9 | C10 | C11 | C12 | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 | D10 | D11 | D12 | E1 | E2 | E3 | E4 | E5 | E6 | E7 | E8 | E9 | E10 | E11 | E12 ::= F | L | B | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 As discussed in class, the positions are relative to the player, with columns A through E, with column A the leftmost, and rows 1 through 12, with the player's headquarters positions in row 1. As discussed in class, piece F is the flag, piece L is a landmine, piece B is a bomb, piece 1 is an engineer, and so on through piece 9, which is a field marshall. Positions B1, D1, B12, and D12 are headquarters positions. Positions B3, D3, C4, B5, D5, B8, D8, C9, B10, and D10 are camps. Within the initial configuration, camps must be empty. No position may be occupied by more than one piece. The initial configuration must place the correct number of each piece (one flag, three landmines, two bombs, three engineers, and so on). All of a player's pieces must be placed on the player's side of the board (rows 1 through 6). The flag must be placed in a headquarters position. Landmines can be placed only within rows 1 and 2. Bombs cannot be placed in row 6. The message that conveys the first move must have the following context-free syntax: ::= ( ) The first of the two positions must be occupied by one of the player's pieces. The second of the two positions must be reachable from the first via road or railroad according to the rules of Luzhanqi. ----------------------------------------------------------------