########################### # # MTTTP Mindless Tic Tac Toe Protocol # v1.0, 1/11/02, Jim Mahoney # # The server waits for single line commands from client, # Each command is identified by initial keyword. # # The server responsds to each command with 4 lines of text. # Lines are terminated by unix \n. # Whitespace is ignored. # # The legal commands that the client can issue are # START [x|o] # MOVE where # DONE # # The tic tac toe board is laid out like this. # a b c # d e f # g h i # so the legal values of "where" are one of the first nine letters. # Each spot is either X, O, or . (period for empty space). # X goes first. # # Commands and positions may be in either upper or lower case. # # The server always responds with 4 lines, # 1 line of information, followed by # 3 lines displaying the board. # # The information line starts with either "OK" or "OOPS", and may # contain key/value pairs in the form key='value'. Defined keys are # your_mark O or X , confirming which side the client will play, # your_move a letter, confirming a move the client has played, # my_move a letter, giving the move that the server has made. # The OOPS condition is returned when # the client command is not understood, or # the client sends an illegal move # # The server algorithm is (of course) up to the implementer - # depending on how mindless you'd like to be. # # The client may issue any of the three commands at any point. # #############################################################