Ad
  • Custom User Avatar
  • Custom User Avatar

    I'm sure that u are creating a new node with Node(pos), a node with default values like passable = True, to access to a node in the grid just pos.position or pos.passable.

  • Custom User Avatar

    I think the description would look a lot cleaner with Conditional rendering.

    Fork

  • Custom User Avatar

    The python's version of this Kata should be rewrite. The implementation of the Node class is not specified. what's more, the Node class is nearly meaningless and increases difficulty unnecessarily. It would be much better to change the way the graph is stored.

  • Default User Avatar

    well i know im the dumb here, but this katas description is just way off.

    • no mention about the Node class
    • no description about its attributes
      the node.position returns no valuable information, at least for dumb me.
      the node.passable returns true for every position.. great invention..

    def find_shortest_path(grid, start_node, end_node):

    for line in grid:
        for pos in line:
            node = Node(pos)
            print(node.position, node.passable)
    

    S0110

    01000

    01010

    00010

    0001E

    (0,0) True
    (0,1) True
    (0,2) True
    (0,3) True
    (0,4) True
    (1,0) True
    (1,1) True
    (1,2) True
    (1,3) True
    (1,4) True
    (2,0) True
    (2,1) True
    (2,2) True
    (2,3) True
    (2,4) True
    (3,0) True
    (3,1) True
    (3,2) True
    (3,3) True
    (3,4) True
    (4,0) True
    (4,1) True
    (4,2) True
    (4,3) True
    (4,4) True

    how im supposed to know which node is truelly passable?

  • Custom User Avatar

    I guess you are refering to the Haskell version of this kata (it's important to always say the langauge you are using). I have not solved this kata in Haskell so I have no idea about the design of the tests. Unfortunately, changing it would invalidate all submitted solutions, which is an eventuality rejected as much as possible. So I'm sorry but you have to do with it.

  • Custom User Avatar

    The massive test (only) gives me the following error:

    Traceback (most recent call last):
      File "tests.py", line 87, in <module>
        test.assert_equals(sorted_string, list(sort(test_string_gen)), "Failed to sort a massive set of random words.")
      File "/workspace/default/solution.py", line 3, in sort
        L=f(words)
      File "/workspace/default/solution.py", line 11, in f
        for i in range(0,len(L),2):
    TypeError: object of type 'itertools.chain' has no len()
    

    That means some tests don't pass a list, which contradicts the description: Write a sort function that will sort a massive list of strings in caseless, lexographic order.

  • Custom User Avatar

    Hello. I need help. I believe I'm missing some important fundamentals here and the question is dumb, but I can't get the data.

    If I write "return grid" it returns plain list of coordinates without any other data. So I see something like [[(0,0),(0,1),..],[(1,1),(1,2),...]etc] instead of the expected matrix blueprint.
    I know how to do it if the function takes the matrix itself, but I don't understand what am I suppose to do with plain list of coordinates.
    So, help, please tell me what am I doing wrong.

    For the record: I believe using "blueprint = grid1_blueprint" in the function must work but it returns an error.

  • Default User Avatar

    I don't think that this should be 3kyu.. there are a plenty of very similar katas rated 4kyu

  • Default User Avatar

    Oh no, it's worse. For some reason author flips labyrinth 90 degrees from it's string representation. Why?

  • Default User Avatar

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

  • Default User Avatar

    there is too much text in stdout or stderr

  • Custom User Avatar

    The "massive" input is only 83681 elements long even though the description says "there will be hundreds of thousands of words to sort". I think the test cases were changed at some point to be lighter but now you can pass them with any sub-O(n^2) algorithm (in fact, a pure C O(n^2) algorithm works too).

  • Custom User Avatar
  • Custom User Avatar

    All words will be between 1 and 8 characters long

    The maximum word length is actually 5 characters.

  • Loading more items...