Ad
  • Custom User Avatar

    Well done for giving the kata a fair crack. I've just come across it and felt the current description is really easy to understand—will have a go shortly as this looks like a fun one!

  • Custom User Avatar

    Can you consider to change your feedback? If you think that now it's worth to complete the kata :)
    Edit : Thanks!

  • Default User Avatar

    That's much less scary! :)

    minor typo: adiacjent

  • Default User Avatar

    Thank you very much for all the suggestions! I updated the description , Do you think it's ok now?
    I thought the description was clear because I 'invented' the problem and it made sense to me in the way it was implicitly , but (now) I see that it's much better with what you suggested.

  • Custom User Avatar

    Added the following which should clarify:

    Note that a "row" in this context is defined as a horizontal row, and the column value of a cell is its
    position in its respective row starting from the left-most cell.
    
  • Custom User Avatar

    I thought it was obvious from the example given. If you look at the positions of the numbers in the initial state, there's only one possibility. Also the example_solution below (taken from the Description) illustrates the rows and columns as well.

    example_solution = [
        [    6,9,8,4    ],
        [   2,3,7,6,5   ],
        [  8,6,0,3,1,9  ],
        [ 7,4,1,5,6,2,3 ],
        [  8,5,9,2,4,7  ],
        [   9,2,4,1,5   ],
        [    1,7,3,8    ]
    ]
    

    In any case, I'll go ahead and add to the Description to make it crystal clear. Thanks for the heads up.

  • Default User Avatar

    Now that I've looked at the values in your test example: arr = [ [2,2], [3,2], [3,5], [6,2], [0,3], [3,3], [0,0], [6,1], [4,0], [2,5] ]
    I can see that the coordinate system is the one at the top right of my image.

    I'd like to see this explicitly stated near the start of the description.

  • Default User Avatar

    Apologies if it's meant to be obvious from the description, but how do you define/number "columns" on the hexagonal grid?
    Is it any of these? Or something else? https://i.imgur.com/SP6lWBG.png

    I'm reluctant to start trying to solve this if I'm unsure of the coordinate system i'm using.

  • Default User Avatar

    If you're going to call your requirements "Bullets", make the first 4 a list, so they actually have bullet points at the start.
    I'd also prefer to have them numbered, for ease of reference when you later mention "If bullet 3 is true:"

    • (1) Add 1 point if <!DOCTYPE html> is the first in the answer.
    • (2) Add 1 point if the begin tag of html is previous to its endtag in the answer.
    • (3) Add 1 point if the begin tag of head is previous to its endtag in the answer.
    • (4) Add 1 point if the begin tag of body is previous to its endtag in the answer.

    I found that most of my time was spent scrolling the description up/down, switching between the "Add a point" rules, and the number/html mapping.
    This would have been less tedious if the rules included the answer numbers:

    • (1) Add 1 point if <!DOCTYPE html> (Line number 5) is the first in the answer.
    • (2) Add 1 point if the begin tag of html (Line number 3) is previous to its endtag (Line number 6) in the answer.
      etc.
  • Default User Avatar

    After a LOT of guesswork, I've now completed "Hamiltonian cycle : check function" and "Hamiltonian cycle : create one !".
    I'm not a mathematician; until today, I'd not heard of Hamiltonian paths/cycles.

    Here are some of the things that made this MUCH more difficult that it should be:

    • The kata's description doesn't tell me that the path is supposed to pass through every point (although the Wiki does)
    • The Wiki has vertices with links between them; the kata has a grid. I guessed that the squares of the grid correspond to vertices, but there was no indication of what links are allowed (can I move diagonally? can I skip over squares? is a "knight's move" allowed?). Based purely on the mention of "the snake game", I guessed (correctly, I think) that you should only be able to move to orthogonally adjacent squares, but I think this should be specified in the description.
    • The Wiki mentions that "the Hamiltonian path problem... is NP-complete", and has a link to another Wiki page which talks about big-O notation. This looks SCARY. It was not obvious that the kata is a far simpler problem. At one point, I was wondering how many mathematical papers on graph theory I would need to read to even understand the problem! I think this will discourage people from attempting this kata.
  • Default User Avatar

    I've now completed both "Hamiltonian cycle : check function" and "Hamiltonian cycle : create one !"
    I see no benefit of "Hamiltonian cycle : check function" being a separate kata.

  • Default User Avatar

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

  • Custom User Avatar

    approved :)

    recursion tag might be appropriate

  • Default User Avatar

    fixed.
    thanks!

  • Default User Avatar

    Not anymore ;)

  • Loading more items...