Skip to content

Commit

Permalink
Remove testing for diagonal coordinate order (#2300)
Browse files Browse the repository at this point in the history
This test was making this exercise much more difficult than before,
and probably invalidated a vast majority of all previous solutions.

Instead of testing for this, instead guarantee that the data received
is "contiguous" and in a regular rectangular shape.
  • Loading branch information
Naeddyr committed Sep 29, 2024
1 parent 7e614a2 commit cb439c5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion exercises/concept/land-grab-in-space/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ch.IsLastClaim(new Plot(new Coord(1,1), new Coord(2,1), new Coord(1,2), new Coor

## 4. Find the plot claimed that has the longest side for research purposes

Implement the `ClaimsHandler.GetClaimWithLongestSide()` method to examine all registered claims and return the plot with the longest side.
Implement the `ClaimsHandler.GetClaimWithLongestSide()` method to examine all registered claims and return the plot with the longest side. The coordinate data in a plot is guaranteed to be in a contiguous rectangular shape.

```csharp
var ch = new ClaimsHandler();
Expand Down
12 changes: 0 additions & 12 deletions exercises/concept/land-grab-in-space/LandGrabInSpaceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,6 @@ public void GetLongestSideReverseInsertionOrder()
Assert.Equal(longer, ch.GetClaimWithLongestSide());
}

[Fact]
[Task(4)]
public void GetLongestSideDiagonal1()
{
var ch = new ClaimsHandler();
var shorter = CreatePlot(new Coord(0, 0), new Coord(0, 10), new Coord(10, 0), new Coord(10, 10));
var longer = CreatePlot(new Coord(0, 0), new Coord(11, 0), new Coord(11, 11), new Coord(0, 11));
ch.StakeClaim(shorter);
ch.StakeClaim(longer);
Assert.Equal(longer, ch.GetClaimWithLongestSide());
}

private Plot CreatePlot(Coord coord1, Coord coord2, Coord coord3, Coord coord4)
{
Type plotType = typeof(Plot);
Expand Down

0 comments on commit cb439c5

Please sign in to comment.