From e2279628e551e5c82f70c739f6c02671e6ccd9fd Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Fri, 15 Feb 2019 12:11:33 +0100 Subject: Feature 'write_lines' -- UNTESTED! --- referee.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'referee.h') diff --git a/referee.h b/referee.h index 0121196..891021d 100644 --- a/referee.h +++ b/referee.h @@ -4,6 +4,7 @@ #include #include #include +#include #include "process.h" using namespace std; @@ -14,6 +15,10 @@ class Referee { bool isEnd = false; vector scores; + bool featureWriteLines = false; + vector> writeLinesList; + + optional readLine(); void readScores(); public: @@ -22,6 +27,7 @@ public: // player: 0 = first player, 1 = second player bool moveValid(int player, const string_view line); + vector> playerWriteLines(); bool gameEnded(); optional> getScores(); @@ -45,4 +51,14 @@ then write a line to stdout that is equal to either 'valid', 'invalid', or 'valid end', the referee should write a line containing as many integers (separated by spaces) as there are players, giving their scores at the end of the game. + +FEATURES +At any time the referee may write 'feature ' to stdout, which enables the +protocol feature with the given name. The following features are supported: +- 'write_lines': After a move validity judgement, the referee should write lines + of the form ' ' to stdout, where is the index of the + player on whose stdin to write . The referee should signal the end of + this list by writing a line 'write_end' to stdout. + This allows the referee to write additional data to players' inputs after they + have written their moves. */ -- cgit v1.2.3-54-g00ecf