2 # your-agent-name-here.m
5 # Created by Daniel Axtens on 28/07/10.
6 # Licensed under an MIT-style license: see the LICENSE file for details.
9 # import various constants and utilities
10 source( "link/MATLAB/matlab-consts.m" )
12 # defence = Defend( foeName , foePromisedAttack );
14 # foeName: string - the name of your foe;
15 # foePromisedAttack : string - the item your foe promised to use
16 # defence: string - the item you wish to use to defend;
18 # Called when your agent needs to defend itself.
20 function defence = Defend( foeName, foePromisedAttack )
22 defence = foePromisedAttack;
27 # [attack, bluff] = Attack( foeName )
29 # foeName: string - the name of your foe
30 # attack: string - the actual attack you want to use
31 # bluff: string - the bluff attack that you say you will use.
33 # Called when your agent needs to attack another agent.
36 function [attack, bluff] = Attack( foeName )
38 attack = RandomAttack();
43 # Results( foeName, isInstigatedByYou, winner, attItem, defItem, bluffItem,
46 # foeName: string - the name of your foe;
47 # isInstigatedByYou : 0=you defended/1=you attacked;
48 # winner : RESULTTYPE - who won
49 # attItem : ITEMTYPE - the item used to attack;
50 # defItem : ITEMTYPE - the item used to defend;
51 # bluffItem : ITEMTYPE - the item that was promised
52 # pointDelta : integer - how your points were affected.
55 # Called after your agent battles another agent, to tell you how the battle goes.
57 function Results( foeName, isInstigatedByYou, winner, attItem, defItem,
58 bluffItem, pointDelta )
65 # This invokes the matlab-link library, which allows your code to talk
66 # to the judging software. Do not remove this line.
67 source( "link/MATLAB/matlab-link.m" );