Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ssmit235
COSC220-A2
Commits
06f529a6
Commit
06f529a6
authored
Jul 30, 2021
by
ssmit235
Browse files
Fixed isBoxComplete method.
parent
25be4ec4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/dotsandboxes/DotsAndBoxesGrid.java
View file @
06f529a6
...
...
@@ -112,8 +112,8 @@ public class DotsAndBoxesGrid {
}
// A box is complete if the north and south horizontals and the east and west verticals have all been drawn.
// FIXME: You'll need to fix this code (after writing a test first).
return
tru
e
;
boolean
isBoxComplete
=
getHorizontal
(
x
,
y
)
&&
getVertical
(
x
,
y
)
&&
getVertical
(
x
+
1
,
y
)
&&
getHorizontal
(
x
,
y
+
1
);
return
isBoxComplet
e
;
}
/** Tries to claim a box for a player. If the box is complete, sets the ownership and returns true. */
...
...
ssmit235
@ssmit235
mentioned in issue
#1 (closed)
·
Jul 30, 2021
mentioned in issue
#1 (closed)
mentioned in issue #1
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment