-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyAgent.ctxt
35 lines (35 loc) · 4.04 KB
/
MyAgent.ctxt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#BlueJ class context
comment0.params=game\ iAmRed
comment0.target=MyAgent(Connect4Game,\ boolean)
comment0.text=\n\ Constructs\ a\ new\ agent,\ giving\ it\ the\ game\ and\ telling\ it\ whether\ it\ is\ Red\ or\ Yellow.\n\ \n\ @param\ game\ The\ game\ the\ agent\ will\ be\ playing.\n\ @param\ iAmRed\ True\ if\ the\ agent\ is\ Red,\ False\ if\ the\ agent\ is\ Yellow.\n
comment1.params=
comment1.target=void\ move()
comment1.text=\n\ The\ move\ method\ is\ run\ every\ time\ it\ is\ this\ agent's\ turn\ in\ the\ game.\ You\ may\ assume\ that\n\ when\ move()\ is\ called,\ the\ game\ has\ at\ least\ one\ open\ slot\ for\ a\ token,\ and\ the\ game\ has\ not\n\ already\ been\ won.\n\ \n\ By\ the\ end\ of\ the\ move\ method,\ the\ agent\ should\ have\ placed\ one\ token\ into\ the\ game\ at\ some\n\ point.\n
comment10.params=column\ myColor\ theirColor
comment10.target=boolean\ settingThemUp(int,\ char,\ char)
comment10.text=\n\ Checks\ to\ see\ if\ a\ move\ is\ setting\ the\ other\ player\ up\ for\ a\ win.\n\ @param\ column\ The\ index\ of\ the\ column\ of\ the\ planned\ move\n\ @param\ myColor\ The\ character\ of\ my\ color\ 'R'\ or\ 'Y'\n\ @param\ theirColor\ The\ character\ of\ their\ color\ 'R'\ or\ 'Y'\n\ @return\ Returns\ true\ if\ the\ planned\ move\ will\ set\ the\ other\ player\ up\ for\ a\ win,\ otherwise\ false\n
comment2.params=columnNumber
comment2.target=void\ moveOnColumn(int)
comment2.text=\n\ Drops\ a\ token\ into\ a\ particular\ column\ so\ that\ it\ will\ fall\ to\ the\ bottom\ of\ the\ column.\n\ If\ the\ column\ is\ already\ full,\ nothing\ will\ change.\n\ \n\ @param\ columnNumber\ The\ column\ into\ which\ to\ drop\ the\ token.\n
comment3.params=column
comment3.target=int\ getLowestEmptyIndex(Connect4Column)
comment3.text=\n\ Returns\ the\ index\ of\ the\ top\ empty\ slot\ in\ a\ particular\ column.\n\ \n\ @param\ column\ The\ column\ to\ check.\n\ @return\ the\ index\ of\ the\ top\ empty\ slot\ in\ a\ particular\ column;\ -1\ if\ the\ column\ is\ already\ full.\n
comment4.params=board\ colNum
comment4.target=int\ getLowestBlank(char[][],\ int)
comment4.text=\n\ Finds\ lowest\ blank\ in\ a\ column\ of\ a\ character\ matrix\ representation\ of\ the\ board\n\ \n\ @param\ board\ the\ character\ matrix\ representation\ of\ the\ board\n\ @param\ colNum\ The\ column\ to\ check\n\ @return\ the\ index\ of\ the\ top\ empty\ slot\ in\ a\ particular\ column;\ -1\ if\ the\ column\ is\ already\ full.\n
comment5.params=
comment5.target=int\ randomMove()
comment5.text=\n\ Returns\ a\ random\ valid\ move.\ If\ your\ agent\ doesn't\ know\ what\ to\ do,\ making\ a\ random\ move\n\ can\ allow\ the\ game\ to\ go\ on\ anyway.\n\ \n\ @return\ a\ random\ valid\ move.\n
comment6.params=myColor
comment6.target=int\ canWin(char)
comment6.text=\n\ Returns\ the\ column\ that\ would\ allow\ the\ agent\ to\ win.\n\ @param\ myColor\ the\ color\ of\ the\ agent\n\ @return\ the\ column\ that\ would\ allow\ the\ agent\ to\ win,\ returns\ -1\ if\ no\ win\ possible\n
comment7.params=myColor\ theirColor
comment7.target=int\ twoAway(char,\ char)
comment7.text=\n\ Returns\ the\ column\ that\ would\ allow\ the\ agent\ to\ be\ one\ move\ away\ from\ winning.\ Like\ the\ win\ method,\ but\ plays\ two\ hypothetical\ moves\ to\n\ determine\ whether\ any\ combination\ of\ two\ moves\ would\ result\ in\ the\ agent\ winning.\ Also\ checks\ if\ the\ move\ sets\ the\ opposite\ player\ up\ to\ win\n\ @param\ myColor\ the\ color\ of\ the\ agent\ to\ be\ tested\n\ @param\ theirColor\ the\ color\ of\ the\ opposing\ agent\n\ @return\ the\ column\ that\ would\ allow\ the\ agent\ to\ be\ one\ move\ away\ from\ winning,\ returns\ -1\ if\ no\ win\ possible\n
comment8.params=
comment8.target=java.lang.String\ getName()
comment8.text=\n\ Returns\ the\ name\ of\ this\ agent.\n\ @return\ the\ agent's\ name\n
comment9.params=board
comment9.target=char\ gameWon(char[][])
comment9.text=\n\ Check\ if\ the\ game\ has\ been\ won.\n\ \n\ @param\ board\ the\ character\ matrix\ representation\ of\ the\ board\n\ @return\ 'R'\ if\ red\ won,\ 'Y'\ if\ yellow\ won,\ 'N'\ if\ the\ game\ has\ not\ been\ won.\n
numComments=11