Skip to content
Snippets Groups Projects
Commit 81ddcd1b authored by William Billingsley's avatar William Billingsley
Browse files

Fix bug where instructions said to implement isInCentre but I'd already implemented it

parent c7a90888
No related branches found
No related tags found
No related merge requests found
...@@ -82,7 +82,6 @@ For this exercise, **the computer should always make the move that leaves it wit ...@@ -82,7 +82,6 @@ For this exercise, **the computer should always make the move that leaves it wit
Before you get to that, though, you'll find several other methods that you need to implement: Before you get to that, though, you'll find several other methods that you need to implement:
* getting a line of squares travelling in a direction (N, NE, E, SE, S, SW, W, or NW) from a square to the edge of the board * getting a line of squares travelling in a direction (N, NE, E, SE, S, SW, W, or NW) from a square to the edge of the board
* determining if a square is in the centre 4 squares (3, 3), (3, 4), (4, 3), (4, 4)
* counting the number of pieces for each player * counting the number of pieces for each player
* determining what pieces would be flipped by placing a piece in a location * determining what pieces would be flipped by placing a piece in a location
* determining whether a move would be valid for a player * determining whether a move would be valid for a player
......
...@@ -63,11 +63,9 @@ extension (l:Location) { ...@@ -63,11 +63,9 @@ extension (l:Location) {
(0 until boardSize).contains(x) && (0 until boardSize).contains(y) (0 until boardSize).contains(x) && (0 until boardSize).contains(y)
// Whether the location l is in the centre squares that are legal for the first 4 moves in Reversi // Whether the location l is in the centre squares that are legal for the first 4 moves in Reversi
// You need to implement this
def isInCentre:Boolean = def isInCentre:Boolean =
val (x, y) = l val (x, y) = l
(x == 3 || x == 4) && (y == 3 || y == 4) (x == 3 || x == 4) && (y == 3 || y == 4)
// ???
// Let's us say, for instance a1 instead of (0, 7). Note that locations are from the top-left down, // Let's us say, for instance a1 instead of (0, 7). Note that locations are from the top-left down,
// but we're used to seeing chess locations written with a1 in the bottom left // but we're used to seeing chess locations written with a1 in the bottom left
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment