-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSnake.ctxt
More file actions
47 lines (47 loc) · 3.33 KB
/
Snake.ctxt
File metadata and controls
47 lines (47 loc) · 3.33 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
#BlueJ class context
comment0.params=col\ snakeGr\ theGame
comment0.target=Snake(java.awt.Color,\ MyBoundedGrid,\ SnakeGame)
comment0.text=\n\ Constructor\ for\ the\ snake\ class\n\ \n\ @precondition\ \ \ \ snakeGr\ has\ a\ greater\ length\ and\ width\ than\ 3.\n
comment1.params=snakeGr\ theGame
comment1.target=Snake(MyBoundedGrid,\ SnakeGame)
comment1.text=\n\ \ Constructor\ for\ the\ snake\ class\ without\ color\n
comment10.params=
comment10.target=java.lang.String\ getOppositeDirection()
comment10.text=\n\ Returns\ the\ opposite\ Direction\n\ \n\ @return\ the\ opposite\ Direction\n
comment11.params=
comment11.target=java.lang.String\ getRightDirection()
comment11.text=\n\ Returns\ the\ Direction\ to\ the\ right\n\ \n\ @return\ direction\ to\ the\ right\n
comment12.params=
comment12.target=java.lang.String\ getLeftDirection()
comment12.text=\n\ Returns\ the\ Direction\ to\ the\ left\n\ \n\ @return\ direction\ to\ the\ left\n
comment13.params=dir
comment13.target=boolean\ validDirection(java.lang.String)
comment13.text=\n\ Returns\ whether\ parameter\ is\ a\ valid\ Direction\n\ \n\ @param\ dir\ \ \ the\ direction\ to\ check\n\ @return\ whether\ it\ was\ valid\ or\ not\n
comment14.params=
comment14.target=boolean\ determineDirection()
comment14.text=\n\ Determines\ the\ direction\ of\ the\ snake\ and\ moves\ it.\n
comment15.params=
comment15.target=int\ getNumItemsEaten()
comment15.text=\n\ Returns\ the\ number\ of\ items\ eaten\n\ \n\ @return\ \ the\ number\ of\ items\ eaten\n
comment2.params=eGrid\ loc
comment2.target=boolean\ isEmpty(MyBoundedGrid,\ Location)
comment2.text=\n\ Checks\ to\ see\ if\ the\ given\ locations\ in\ the\ given\ grid\ are\ empty.\n
comment3.params=
comment3.target=java.util.ArrayList\ getLocations()
comment4.params=
comment4.target=Location\ getHeadLocation()
comment5.params=
comment5.target=Location\ getTailLocation()
comment6.params=addGrid\ loc
comment6.target=void\ addToLocations(MyBoundedGrid,\ Location)
comment6.text=\n\ Adds\ a\ Block\ to\ a\ given\ location\ in\ the\ given\ grid.\n\ \n\ @param\ \ \ addGrid\ \ \ \ grid\ where\ the\ block\ will\ be\ placed\ in.\n\ @param\ \ \ locs\ \ \ \ location\ where\ the\ block\ will\ be\ placed\ in.\n
comment7.params=deltaRow\ deltaCol
comment7.target=boolean\ translate(int,\ int)
comment7.text=\n\ Moves\ a\ snake\ by\ a\ given\ number\ of\ rows\ or\ columns.\n\ \n\ @param\ \ \ deltaRow\ \ \ \ number\ of\ rows\ the\ snake\ block\ will\ be\ moved.\n\ @param\ \ \ deltaCol\ \ \ \ number\ of\ columns\ the\ snake\ block\ will\ be\ moved.\n\ \n\ @return\ \ true\ if\ it\ is\ possible\ to\ translate\ the\ snake\ block\ to\ the\n\ \ \ \ \ \ \ \ \ \ location\ designated,\ otherwise;\n\ \ \ \ \ \ \ \ \ \ false.\n
comment8.params=dir
comment8.target=boolean\ changeDirection(java.lang.String)
comment8.text=\n\ Changes\ the\ direction\ that\ the\ snake\ is\ going\ based\ off\ of\ input.\n\ Will\ not\ change\ direction\ if\ \n\ \ \ \ \ \ it\ is\ already\ going\ in\ the\ direction\ requested\n\ \ \ \ \ \ it\ is\ going\ in\ the\ opposite\ off\ the\ direciton\ requested\n\ \ \ \ \ \ \n\ @param\ dir\ \ \ the\ direction\ requested\n\ \n\ @return\ \ true\ if\ the\ direction\ was\ successfully\ changed;\ otherwise,\n\ \ \ \ \ \ \ \ \ \ false\n
comment9.params=
comment9.target=java.lang.String\ getDirection()
comment9.text=\n\ Returns\ the\ Direction\n\ \n\ @return\ the\ direciton\n
numComments=16