Ad
  • Default User Avatar
  • Default User Avatar

    HA I thought it said Matt Bruner which is the name of a real life mate of mine, nice solution by the way

  • Custom User Avatar

    I'm glad you managed to solve the kata, but I'm not joking either: when talking about matrices x and y are the most commonly used variables for coordinates representation like in plotting in math. Programming is not math, though - the first axis here is not horizontal but vertical, so x generally stands for rows, and y stands for columns.

  • Default User Avatar

    I admit I'm not a serious programmer, but unfortunately I'm not joking either. This is the first time I'm seeing x be a vertical dimension and y a horizontal one.

  • Custom User Avatar

    Are you even serious? A list of rows is the most common practice where (x, y) means row X, colunm Y; it is even stated in the description that (x, y) tuples should be interpreted as toll_map[x][y] positions, not as toll_map[y][x]. If it WAS a list of columns, it'd be explicitly stated like in this kata (as it's an uncommon practice to do so). Don't raise an issue if you don't understand the task/can't read the description properly.

    The simplest fix is to just transpose all direction strings in the example output and test cases which would swap y and x and confirm to the more sensible format in the clarification. I know this would break already submitted solutions but 13 is not that many and given the age of this kata all submitters are most likely still active.

    Now this is just bullshit. No one will change the kata so 13 correct solutions will fail and your incorrect one will succeed.

  • Default User Avatar

    There seems to be a complete mismatch in the order of the coordinates between the example and test cases on the one hand (y, x) and the clarification on the other (x, y).

    The output directions in the example suggest that toll_map is a list of rows (instead of cols) which means a cell is accessed via toll_map[y][x]. And the value of finish suggests that even tuples are in this y, x order. Looking at others' comments this seems to be the case for test cases as well, e.g.:

    (3, 0), (3, 7), ['right', 'right', 'right', 'right', 'right', 'right', 'right']
    

    The simplest fix is to just transpose all direction strings in the example output and test cases which would swap y and x and confirm to the more sensible format in the clarification. I know this would break already submitted solutions but 13 is not that many and given the age of this kata all submitters are most likely still active.

  • Default User Avatar

    That will depend on the way you implement it (there are a lot of possible variations). But it can be done with that approach, yes.

  • Default User Avatar

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