Ad
  • Default User Avatar

    For input {3,2,2,3,2,1,1,2,3,3,2,2,5,1,2,2,4,3,3,2,1,2,2,4} my algorithm produces valid solution
    [ [ 2, 4, 1, 3, 5, 6 ], [ 1, 6, 3, 2, 4, 5 ], [ 4, 1, 6, 5, 2, 3 ], [ 6, 5, 2, 1, 3, 4 ], [ 5, 3, 4, 6, 1, 2 ], [ 3, 2, 5, 4, 6, 1 ] ]
    yet the test expect
    [ [ 2, 1, 4, 3, 5, 6 ], [ 1, 6, 3, 2, 4, 5 ], [ 4, 3, 6, 5, 1, 2 ], [ 6, 5, 2, 1, 3, 4 ], [ 5, 4, 1, 6, 2, 3 ], [ 3, 2, 5, 4, 6, 1 ] ]
    and thus fails.
    Problem with the tests is that there might be more than valid solution!

  • Default User Avatar

    C++: For input {2,2,1,3,2,2,3,1,1,2,2,3,3,2,1,3} my algorithm produces (valid) solution {{1,3,4,2},{4,2,1,3},{3,4,2,1},{2,1,3,4}} yet the test says it's wrong.

  • Custom User Avatar

    Is there a way to get the intended result of the random tests in C++?
    I manually checked all the tests hands against my outcome and don't see any fails.

  • Custom User Avatar

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

  • Default User Avatar

    C:

    • unehlpful assertion messages
    • input should be const int[24]
    • memory model of the returned pointer is not explained
  • Default User Avatar

    C:

    • input should be const int[16]
    • unhelpful assertion messages
    • the memory model for the output is not explained
  • Custom User Avatar

    Poker question no. 1:
    it("Highest pair wins", function() { assert(Result.loss, "6S AD 7H 4S AS", "AH AC 5H 6H 7S");});

    --> Is this an error in the test cases? (the pair is equal: both have a pair of aces)

    --> Is this saying that only in case of an equal pair, the suit is relevant? (clubs beats spades)

    --> Is this saying that in case of an equal pair, the highest card is deciding? (5 beats 4)

  • Custom User Avatar

    Go preloaded tests are not quite right. It doesn't correctly pick up the set variables clues and expected. I assume because the examples run after all lines of the Describe are evaluated, so the way it's done it only runs with last clues and examples. Could we move setting these variables inside the It?

    var _ = Describe("Sky Scraper", func() {
      
      It("can solve 6x6 puzzle 1", func() {
        clues := []int{ 3, 2, 2, 3, 2, 1,
              1, 2, 3, 3, 2, 2,
              5, 1, 2, 2, 4, 3,
              3, 2, 1, 2, 2, 4}
              
        expected := [][]int{{ 2, 1, 4, 3, 5, 6 },
                { 1, 6, 3, 2, 4, 5 },
                { 4, 3, 6, 5, 1, 2 },
                { 6, 5, 2, 1, 3, 4 },
                { 5, 4, 1, 6, 2, 3 },
                { 3, 2, 5, 4, 6, 1 }}
    
          Expect(SolvePuzzle(clues)).To(Equal(expected))
      })
      
      It("can solve 6x6 puzzle 2", func() {
        clues := []int{ 0, 0, 0, 2, 2, 0, 0, 0, 0, 6, 3, 0, 0, 4, 0, 0, 0, 0, 4, 4, 0, 3, 0, 0}
        expected := [][]int{{ 5, 6, 1, 4, 3, 2 },  { 4, 1, 3, 2, 6, 5 }, { 2, 3, 6, 1, 5, 4 }, 
                { 6, 5, 4, 3, 2, 1 }, { 1, 2, 5, 6, 4, 3 }, { 3, 4, 2, 5, 1, 6 }}            
    
        Expect(SolvePuzzle(clues)).To(Equal(expected))
      })
      
       It("can solve 6x6 puzzle 3", func() {
         clues := []int{ 0, 3, 0, 5, 3, 4, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 2, 3, 3, 2, 0, 3, 1, 0}
         expected := [][]int{{ 5, 2, 6, 1, 4, 3 }, { 6, 4, 3, 2, 5, 1 }, { 3, 1, 5, 4, 6, 2 }, 
                { 2, 6, 1, 5, 3, 4 }, { 4, 3, 2, 6, 1, 5 }, { 1, 5, 4, 3, 2, 6 }}
    
         Expect(SolvePuzzle(clues)).To(Equal(expected))
       })
    })
    
  • Custom User Avatar

    image is broken in the description.

  • Custom User Avatar

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

  • Custom User Avatar

    Python (probably other languages also) too: modifying input can influence the random tests: see this

  • Custom User Avatar

    [Python]

    Random tests are full of cheaters, e.g.:

    Failed at test 32: '7C 7S 3S 7H 5S' against '7C 7S KH 2H 7H': 'Tie' should equal 'Loss'
    

    There can't be two "three of a kind" with the same cards.

  • Default User Avatar

    My solution passed, but does not work properly:
    my hand "7C 7S 2S 2H AH" wins against "KC KH 5D QS QC".

    A test is missing for this case I guess.

  • Custom User Avatar

    This kata is a candidate for retirement as broken: https://github.com/codewars/content-issues/issues/205

    Please share your opinion how to handle this broken kata: retire? fix? Something else?

  • Default User Avatar

    I solved it using python and 7 basic tests pass without a problem, but at "Random coordinates" attempt I get a message "None should equal '11'". Could someone help me understand why this is happening?

  • Loading more items...