From 99e58b5bf2cf64614798aaa41059433ce2cf1b99 Mon Sep 17 00:00:00 2001 From: Daniel Axtens Date: Thu, 9 Sep 2010 16:14:28 +0800 Subject: [PATCH] documentation --- doc/POINTS.txt | 9 ++++++++ doc/README.txt | 3 ++- doc/UNSUPPORTED.txt | 40 ++++++++++++++++++++++++++++++--- issues.txt | 2 +- technicalities.txt | 55 --------------------------------------------- 5 files changed, 49 insertions(+), 60 deletions(-) create mode 100644 doc/POINTS.txt delete mode 100644 technicalities.txt diff --git a/doc/POINTS.txt b/doc/POINTS.txt new file mode 100644 index 0000000..e5857cc --- /dev/null +++ b/doc/POINTS.txt @@ -0,0 +1,9 @@ +POINTS.txt: The points table. + +WINNER TRUTH/LIE ATTACKER POINTS DEFENDER POINTS +Attacker Lie 3 -3 +Attacker Truth 2 -2 +Defender Lie -2 2 +Defender Truth -3 3 +Tie Lie 0 0 +Tie Truth 1 1 diff --git a/doc/README.txt b/doc/README.txt index 2616460..79cbce7 100644 --- a/doc/README.txt +++ b/doc/README.txt @@ -4,11 +4,12 @@ Congratulations, you've found the documentation! - WELCOME.txt: A general introduction to the competition. - HOWTO.txt: A guide to getting the software you need to compete, and making your first baby steps towards competing. + - POINTS.txt: The points table. - JUDGING.txt: An insight into the capricious and arbitrary mind of the organiser on how your agent will be judged. - http://progcomp.ucc.asn.au/Rules : the rules of the competition - http://progcomp.ucc.asn.au/FAQs : Frequently Asked Questions - http://progcomp.ucc.asn.au/More%20Info : General Info - NOTES.txt: possibly important stuff that doesn't fit anywhere else. - INTERNALS.txt: Internal information which might interest you but which you shouldn't rely upon. - - UNSUPPORTED.txt: How to use a language that isn't Python, C/C++, Java or Octave/Matlab. + - UNSUPPORTED.txt: The wire protocol - useful for debugging. Also contains details on how to use a language that isn't Python, C/C++, Java or Octave/Matlab. - LICENSE: the terms under which the code is released to you. \ No newline at end of file diff --git a/doc/UNSUPPORTED.txt b/doc/UNSUPPORTED.txt index 02317e8..fb73fca 100644 --- a/doc/UNSUPPORTED.txt +++ b/doc/UNSUPPORTED.txt @@ -1,4 +1,38 @@ -UNSUPPORTED.txt: You should not need this file. +UNSUPPORTED.txt: This file describes the wire protocol. You should only need this if you're debugging an external agent, or if you're interested in writing an agent in an unsupported language. -Consult the website. -FIXME: more info? \ No newline at end of file +If you are interested in using an unsupported language, consult the website for details on how to check with the organiser first. + +=== Wire protocol === + +The syntax for input and output is as follows. Every line of input given by the supervisor must be replied with the correct response. +Segmentation fault is never the correct response :-). Rumour has it that if you just use Python, this won't happen. + +The angle brackets (<>) indicate whether the line is output from the agent or input to it respectively, and are not part of the actual formatting. + +Syntax for when your agent is spawned: +>HI uuid + +Syntax for an attacking agent: +>ATTACK foeName +ATTACK agent00002 +DEFEND foeName foePromisedItem +DEFEND agent00001 Scissors +RESULTS foeName isInstigatedByYou winner yourItem theirItem promisedItem pointChange +RESULTS agent00001 False Attacker Rock Paper Scissors -2 +BYE +{program exits without responding} \ No newline at end of file diff --git a/issues.txt b/issues.txt index 80daf7c..512da50 100644 --- a/issues.txt +++ b/issues.txt @@ -1,6 +1,6 @@ - number of agents can spiral out of control very quickly, e.g. if Wash and Angel start duking it out. * Need to make supervisor smart enough to kill montonically increasing sequences. - - points table doesn't agree with technicalities doc + - agents die after MAX_AGE fights, not MAX_AGE rounds - code seems to trust you not to monkey around with your stats...? - coding styles are inconsistent throughout diff --git a/technicalities.txt b/technicalities.txt deleted file mode 100644 index 1165432..0000000 --- a/technicalities.txt +++ /dev/null @@ -1,55 +0,0 @@ -Points Table: - -ACTION RESULT YOUR POINTS THEIR POINTS -Tell the truth Win +2 -3 -Tell the truth Lose -3 +4 -Tell the truth Tie +3 +3 -Lie Win +4 -5 -Lie Lose -3 +3 -Lie Tie 0 0 - -Python Agents: - -Your agent class should at the very least provide the following: -class : - points = 0 # Will be kept updated by the supervisor. No point modifying it. - children = 0 # Will also be kept updated by the supervisor. - state = {} # You needn't actually keep state, and it certainly doesn't have to be a dictionary. - def Defend (self, foeName, foePromisedAttack): # foeName and foePromisedAttack are both strings. - return "Rock" # Not a very good idea, but this is the format you need to use. - def Attack (self, foeName): # Also note that the supervisor doesn't use named arguments. - return "Rock", "Paper" # Real first, then promised. Won't they be surprised! - def Results (self, foeName, isInstigatedByYou, winner, yourItem, theirItem, promisedItem, pointChange): # The second argument is a boolean. - pass # You probably want to store at least some of this information. - -Other Agents: - -The syntax for input and output is as follows. Every line of input given by the supervisor must be replied with the correct response. -Segmentation fault is never the correct response :-). Rumour has it that if you just use Python, this won't happen. - -The angle brackets (<>) indicate whether the line is output from the agent or input to it respectively, and are not part of the actual formatting. - -Syntax for an attacking agent: ->ATTACK foeName -ATTACK agent00002 -DEFEND foeName foePromisedItem -DEFEND agent00001 Scissors -RESULTS foeName isInstigatedByYou winner yourItem theirItem promisedItem pointChange -RESULTS agent00001 False Attacker Rock Paper Scissors -2 -BYE -{program exits without responding} \ No newline at end of file -- 2.20.1