Ad
  • Custom User Avatar

    This kata needs a complete overhaul. Better input/output format, test verification and random test generator. Author has left the building and I ain't touching the current C++ and C# code. Let's retire this and make the 8x8 variation the author hinted at in the description.

  • Custom User Avatar
  • Custom User Avatar

    This is the case for many tests, here's another one:

    actual:
    +---+---+---+---+---+---+---
    | ◄ | ► |   |   | ▲ |   | 3 	1(1) ◄ ■ ►
    +---+---+---+---+---+---+---	2(2) ◄ ►
    |   |   | ♦ |   | ■ |   | 2 	3(3) ♦
    +---+---+---+---+---+---+---
    |   |   |   |   | ▼ |   | 1 
    +---+---+---+---+---+---+---
    |   |   | ♦ |   |   |   | 1 
    +---+---+---+---+---+---+---
    |   |   |   |   |   |   | 0 
    +---+---+---+---+---+---+---
    |   |   | ♦ |   | ◄ | ► | 3 
    +---+---+---+---+---+---+---
    | 1 | 1 | 3 | 0 | 4 | 1 |
    expected:
    +---+---+---+---+---+---+
    | ♦ | . | ▲ | . | ▲ | . |
    +---+---+---+---+---+---+
    | . | . | ▼ | . | ■ | . |
    +---+---+---+---+---+---+
    | . | . | . | . | ▼ | . |
    +---+---+---+---+---+---+
    | . | . | ♦ | . | . | . |
    +---+---+---+---+---+---+
    | . | . | . | . | . | . |
    +---+---+---+---+---+---+
    | . | ♦ | . | . | ◄ | ► |
    +---+---+---+---+---+---+
    
  • Custom User Avatar

    Example test: multiple solutions are possible

    actual:
    +---+---+---+---+---+---+---
    |   |   |   | ◄ | ► |   | 2 	1(1) ◄ ■ ►
    +---+---+---+---+---+---+---	2(2) ◄ ►
    |   |   |   |   |   |   | 0 	3(3) ♦
    +---+---+---+---+---+---+---
    |   | ♦ |   |   |   |   | 1 
    +---+---+---+---+---+---+---
    | ▲ |   | ▲ |   | ♦ |   | 3 
    +---+---+---+---+---+---+---
    | ▼ |   | ■ |   |   |   | 2 
    +---+---+---+---+---+---+---
    |   |   | ▼ |   | ♦ |   | 2 
    +---+---+---+---+---+---+---
    | 2 | 1 | 3 | 1 | 3 | 0 |
    expected:
    +---+---+---+---+---+---+
    |   | ♦ |   | ♦ |   |   |
    +---+---+---+---+---+---+
    |   |   |   |   |   |   |
    +---+---+---+---+---+---+
    |   |   |   |   | ▲ |   |
    +---+---+---+---+---+---+
    | ▲ |   | ▲ |   | ▼ |   |
    +---+---+---+---+---+---+
    | ▼ |   | ■ |   |   |   |
    +---+---+---+---+---+---+
    |   |   | ▼ |   | ♦ |   |
    +---+---+---+---+---+---+
    
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Quite nice and funny kata to solve in fact, good job.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    I love this solution - it's certainly the most readable!

  • Custom User Avatar

    @angelplusultra
    Distinct() keeps the first instance of an element and discards the rest.

    The reason we reverse is because we want to keep the last item, not the first. A requirement from the kata description: "keeping the last ( rightmost ) occurrence of each element"

    So we reverse it, remove the duplicates, then reverse it again to get it back to the original order.

  • Custom User Avatar

    Why are you reversing the array in the first place?

  • Custom User Avatar

    Initial grid is not extensively tested; every test case is already unique by clues.

    There should be test cases with the same clue but different grids.

  • Custom User Avatar

    Random tests only consists of a small set of fixed inputs, so it is very easy to hard code against all of them.

  • Default User Avatar

    it returns only uniqie elements.
    So if you have numbers 1,2,3,5,4,1,2,3 your solution would be 5,4,1,2,3.
    Method Reverse makes this array look like 3,2,1,4,5,3,2,1. Then method Distinct removes duplicates (second and all further duplicates), so we have it like 3,2,1,4,5. And next reverse returns an answer 5,4,1,2,3

  • Custom User Avatar
  • Custom User Avatar

    End trimming for end digits are inconsistent: 2nd row ending 5/6 and 3rd row 2 expects no trimming but everything else expects trimming.

  • Loading more items...