Joshua C. Gilbert wrote:
>> I don't understand what you meant by "In order to register a move, your agent
>> should invoke the integer valued function...". Am I meant to write this
>> function? If not, how do I call it? I can execute a call to the shell 'play
>> 1434', which can return a value. Is that what you meant?
Yes, you write this function. If your program is invoked with 1 (Black) you
make an initial move by printing 4 digits to stdout. You then read 4 digits,
blocking, from the stdin; this represents the opponents move. As I understand
it, if your program is invoked with 2 (White), then you need to print 0 and
then read to receive the next move.
>> So to restate:
>> You call python sunny 1. sunny formulates his move and calls `play 1434` which
>> returns the value of blinky's move. sunny then makes his move and play
>> continues until a winner is found. There is no need to error check input (if
>> sunny receives a move, it is legal) nor handle any termination states other
>> than one player winning (if the other agent breaks a rule, kill my process and
>> declare me the winner).
>> Do I have this right? If not, how so?
Yes, this sounds right. Your program only receives valid moves and receiving
a move implies the opponent has just made a legal move that did not end the game.