From 043c92f850a88c67ae9d9a270169ec85198e8cf6 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 23 Dec 2011 17:59:57 +0100 Subject: [PATCH] Example client: Document the state structure --- client/example.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/client/example.pl b/client/example.pl index 491799d..2eebd89 100755 --- a/client/example.pl +++ b/client/example.pl @@ -18,6 +18,17 @@ use warnings; $/ = "\r\n"; +# The example agent uses $state to hold its state structure. It is +# a HASHREF with the following fields: +# { +# tick => NUMBER (current tick id) +# energy => NUMBER (current energy) +# visual => [ +# CHAR[2], ... +# ] (type-agent character pairs for perceived tiles) +# } + + # Read server input associated with a single tick and update the state # structure accordingly. sub tick($$) {