-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConnectFourGame.ctxt
96 lines (96 loc) · 5.35 KB
/
ConnectFourGame.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#BlueJ class context
comment0.target=ConnectFourGame
comment1.params=pSize
comment1.target=ConnectFourGame(int)
comment1.text=A\ constructor\ method\ that\ initializes\ all\ fields,\ passed\ bSize\ from\ the\ GUI\ \ *
comment10.params=
comment10.target=int\ getComputerScore()
comment10.text=
comment11.params=
comment11.target=java.lang.String\ toString()
comment11.text=
comment12.params=
comment12.target=boolean\ isWinner()
comment12.text=Called\ mulitple\ times\ from\ the\ panel\ class\ to\ determine\ winners\ and\ find\ the\ blocking\ move\ from\ the\ computer
comment13.params=player
comment13.target=boolean\ isWinner(int)
comment13.text=Calls\ methods\ which\ contain\ specific\ if\ statements;\ each\ method\ checks\ a\ specific\ way\ to\ win\ from\ the\ last\ chip\ played
comment14.params=player
comment14.target=boolean\ checkVerticalWin(int)
comment14.text=Checks\ the\ 4\ positions\ values\ to\ see\ if\ they\ are\ all\ the\ same\ which\ would\ indicate\ a\ win
comment15.params=player
comment15.target=boolean\ checkHorizontalWin(int)
comment15.text=Checks\ the\ 4\ positions\ values\ to\ see\ if\ they\ are\ all\ the\ same\ which\ would\ indicate\ a\ win
comment16.params=player
comment16.target=boolean\ checkDiagonal1Win(int)
comment16.text=Checking\ for\ descending\ diagonals\ (from\ left\ to\ right)
comment17.params=player
comment17.target=boolean\ checkDiagonal2Win(int)
comment17.text=Checking\ for\ ascending\ diagonals\ (from\ left\ to\ right)
comment18.params=dLevel
comment18.target=int\ setDifficultyLevel(java.lang.String)
comment18.text=Passed\ a\ string\ from\ the\ panel\ class\ which\ is\ checked\ by\ the\ switch\ statement\ and\ returns\ the\ users\ desire\ difficulty\ level\ as\ an\ intiger\ in\ milliseconds
comment19.params=
comment19.target=int\ getTrackStrategy()
comment19.text=Allows\ the\ Panel\ Class\ to\ get\ the\ current\ strategy\ of\ the\ computer
comment2.params=
comment2.target=void\ setBlockingMove()
comment2.text=Will\ swap\ the\ value\ of\ the\ last\ move\ from\ user\ to\ computer\ for\ blocking\ move
comment20.params=strategy
comment20.target=void\ setTrackStrategy(int)
comment20.text=Allows\ the\ strategy\ to\ be\ changed\ depending\ on\ the\ availability\ of\ open\ spaces\ relative\ to\ the\ last\ move\ made
comment21.params=bRow\ bCol
comment21.target=int\ smartMoves(int,\ int)
comment21.text=Passed\ the\ row\ and\ column\ of\ the\ last\ move\ the\ computer\ made.\ Depending\ on\ the\ strategy\ of\ the\ computer,\ priorities\ will\ be\ made\ for\ checking\ and\ placing\ the\ next\ move
comment22.params=bRow\ bCol
comment22.target=boolean\ checkSides(int,\ int)
comment22.text=If\ the\ last\ move\ made\ by\ the\ computer\ was\ a\ horizontal\ move\ (tracked\ by\ trackStrategy\ variable)\ we\ want\ the\ next\ move\ to\ follow\ a\ horizontal\ strategy
comment23.params=bRow\ bCol
comment23.target=boolean\ checkAboveBelow(int,\ int)
comment23.text=If\ the\ last\ move\ made\ by\ the\ computer\ was\ a\ verticle\ move\ (tracked\ by\ trackStrategy\ variable)\ we\ want\ the\ next\ move\ to\ follow\ a\ verticle\ strategy
comment24.params=bRow\ bCol
comment24.target=boolean\ checkUpperLeft(int,\ int)
comment24.text=If\ the\ last\ move\ made\ by\ the\ computer\ was\ a\ horizontal\ move\ (tracked\ by\ trackStrategy\ variable)\ we\ want\ the\ next\ move\ to\ follow\ a\ horizontal\ strategy
comment25.params=bRow\ bCol
comment25.target=boolean\ checkUpperRight(int,\ int)
comment25.text=If\ the\ last\ move\ made\ by\ the\ computer\ was\ a\ horizontal\ move\ (tracked\ by\ trackStrategy\ variable)\ we\ want\ the\ next\ move\ to\ follow\ a\ horizontal\ strategy
comment26.params=bRow\ bCol
comment26.target=boolean\ checkLowerLeft(int,\ int)
comment26.text=If\ the\ last\ move\ made\ by\ the\ computer\ was\ a\ lower\ left\ diagonal\ move\ (tracked\ by\ trackStrategy\ variable)\ we\ want\ the\ next\ move\ to\ follow\ a\ left\ diagonal\ strategy
comment27.params=bRow\ bCol
comment27.target=boolean\ checkLowerRight(int,\ int)
comment27.text=If\ the\ last\ move\ made\ by\ the\ computer\ was\ a\ Lower\ Right\ diagonal\ move\ (tracked\ by\ trackStrategy\ variable)\ we\ want\ the\ next\ move\ to\ follow\ a\ Lower\ Right\ diagonal\ strategy
comment28.params=
comment28.target=int\ setFirstMove()
comment28.text=
comment29.params=
comment29.target=int\ getLastCol()
comment29.text=
comment3.params=pPlayer
comment3.target=int\ nextPlayer(int)
comment3.text=Switches\ player\ from\ the\ current\ player\ to\ the\ other.
comment30.params=
comment30.target=int\ getLastRow()
comment30.text=
comment31.params=
comment31.target=int\ randomMove()
comment31.text=For\ the\ first\ move\ a\ chip\ will\ be\ placed\ at\ random
comment4.params=
comment4.target=void\ undo()
comment4.text=Resets\ last\ move\:\ Assigns\ -1\ to\ the\ last\ assignment\ on\ the\ board
comment5.params=
comment5.target=void\ reset()
comment5.text=Resets\ the\ board\ for\ a\ new\ game.\ This\ method\ is\ called\ from\ the\ following\ ConnectFourPanel\ class.
comment6.params=pCol
comment6.target=int\ selectCol(int)
comment6.text=Determines\ which\ column\ a\ chip\ will\ fall\ into.\ This\ method\ is\ called\ from\ the\ following\ ConnectFourPanel\ class,\ whenever\ the\ user\ clicks\ a\ JButton.
comment7.params=move
comment7.target=void\ setUserScore(int)
comment7.text=
comment8.params=move
comment8.target=void\ setComputerScore(int)
comment8.text=
comment9.params=
comment9.target=int\ getUserScore()
comment9.text=
numComments=32