5 # Created by Daniel Axtens on 28/07/10.
6 # Licensed under an MIT-style license: see the LICENSE file for details.
9 # don't allow this file to be mistaken for a function file.
12 # import various constants and utilities
13 source( "link/MATLAB/matlab-consts.m" )
15 # defence = Defend( foeName , foePromisedAttack );
17 # foeName: string - the name of your foe;
18 # foePromisedAttack : string - the item your foe promised to use
19 # defence: string - the item you wish to use to defend;
21 # Called when your agent needs to defend itself.
23 function defence = Defend( foeName, foePromisedAttack )
27 defence = foePromisedAttack;
32 # [attack, bluff] = Attack( foeName )
34 # foeName: string - the name of your foe
35 # attack: string - the actual attack you want to use
36 # bluff: string - the bluff attack that you say you will use.
38 # Called when your agent needs to attack another agent.
41 function [attack, bluff] = Attack( foeName )
45 attack = RandomAttack();
50 # Results( foeName, isInstigatedByYou, winner, attItem, defItem, bluffItem,
53 # foeName: string - the name of your foe;
54 # isInstigatedByYou : 0=you defended/1=you attacked;
55 # winner : RESULTTYPE - who won
56 # attItem : ITEMTYPE - the item used to attack;
57 # defItem : ITEMTYPE - the item used to defend;
58 # bluffItem : ITEMTYPE - the item that was promised
59 # pointDelta : integer - how your points were affected.
62 #Called after your agent battles another agent, to tell you how the battle goes.
64 function Results( foeName, isInstigatedByYou, winner, attItem, defItem,
65 bluffItem, pointDelta )
72 # This invokes the matlab-link library, which allows your code to talk
73 # to the judging software
74 source( "link/MATLAB/matlab-link.m" );