5 # Created by Daniel Axtens on 28/07/10.
6 # Licensed under an MIT-style license: see the LICENSE file for details.
9 # A collection of useful functions and constants for use in your agent-writing.
10 # Please use the symbolic values (see the sample agents) and don't use hard-coded
11 # values: if we have to change how things are represented internally, for example
12 # to make things run faster, we don't want to suddenly have your agent break.
14 # For example, use rps.rock to get a rock, don't use 1.
17 # Define some constants
18 # access these with rps.<whatever>, see the sample agents for examples
25 "itemToString", {{ "Rock", "Paper", "Scissors" }}
29 function item = RandomAttack()
32 switch (floor(rand(1)*3))
43 function item = stringToItem( itemString )
54 # this shouldn't happen; this is passed by the supervisor, not a user
55 error( "tried to convert invalid string into Rock/Paper/Scissors!" )