Ad
  • Default User Avatar

    I've been using Go for a while. It would be cool to translate this into Go. But I've always found translations difficult to do. Usually the myself and the kata author have no idea how to do it.

    If I translated it into Go, would you help me do that?

  • Default User Avatar

    Thanks for ressurecting this kata, it's a pretty good one.

    I don't understand the way you're handling the new lines at all. I don't see why my original code works for all but a few tests? There must be something different about those ones.

    But I'll just use that last line of code you provided. Thanks again.

  • Default User Avatar

    To get it to pass, I had to do this:

    if width == 3 and height == 3:
        return outputString[1:-1]
    if width == 5 and height == 5:
        return outputString[1:-1]
    if width == 10 and height == 10:
        return outputString[1:-1]
    return outputString
    

    So that it removes the leading and trailing '\n' for the small tests.

  • Default User Avatar

    The last few lines of my code - which I use to return the problem in the correct format are these:

    outputString = "\n"
    for row in theMap:
        outputString += ''.join(row) + '\n'
    return outputString
    

    Which gives the correct format for the bulk of the problems. If I remove the leading and trailing '\n' then the first few tests pass, but the rest don't.

  • Default User Avatar

    Hi, I've basically solved this using python. But I get kind of a formatting error with the first few tests...
    The bulk of the tests seem to need a leading and trailing '\n' newline character, but the first few don't...

    Sorry for the long post, but I don't know how to show this more concisely.

    
    Time: 4106ms Passed: 305Failed: 6Exit Code: 1
    Test Results:
    Fixed tests
    No solution
    3x3
    '\nSX.\nXP.\nXXG\n' should equal 'SX.\nXP.\nXXG'
    '\n.S.\n.P.\n.G.\n' should equal '.S.\n.P.\n.G.'
    '\n...\nSPG\n...\n' should equal '...\nSPG\n...'
    '\n...\nSG.\n...\n' should equal '...\nSG.\n...'
    Completed in 0.45ms
    5x5
    '\n.SP..\nXXXP.\n.XPXX\n.PX..\nG...X\n' should equal '.SP..\nXXXP.\n.XPXX\n.PX..\nG...X'
    Completed in 0.18ms
    
    ...
    
    Same for 10x10
    
    ...
    

    But then all the below cases solve no problem at all:

    More tests
    More fixed tests
    (4 of 4 Assertions)
    Random tests
    (300 of 300 Assertions)
    Completed in 3585.46ms
    
    
  • Default User Avatar

    I really enjoyed this kata! Is the author accepting translations?

  • Default User Avatar

    I have the crappiest solution possible. Tell me I'm wrong!

  • Default User Avatar

    I answered my own question. It is.

  • Default User Avatar

    Is this doable in Python in 2023?

  • Default User Avatar

    I really enjoyed this one. Great kata, thanks.

  • Default User Avatar

    What an excellent kata!
    For the life of me I can't see why this test is true:

        [*"__GP"],
        [*"_P__"],
        [*"W___"],
        [*"____"]
    

    You can move to squares (0,1) and (1,0) but you can't tell anything after that can you?

    At (1,0) you smell the wumpus and feel the wind of a bottomless pit. But you don't know which is which - so you can't do anything.

    At (0,1) you feel the wind of a bottomless pit. But again, you don't know whether it's down or right - so you can't move any further.

    And you can't use the knowledge that both of those squares feel windy, because there could be pits at (0,2) and (2,0). With the wumpus at (1,1).

    A hint would be appreciated :)

  • Default User Avatar

    I just replaced your factorial function with one I think is a bit simpler. The big.MulRange function is quite handy.

  • Default User Avatar

    Man, I must be looking at this one strangely. I can get the level, but the border around the outside is very difficult to do. Seems like a level 3 kata to me. Must be missing something.

  • Default User Avatar

    Awesome, thanks.

  • Default User Avatar

    Problem with Go random tests I believe:

    Copy/paste goes all wrong, but you can see what I mean I think. Every case where there's a rook or queen below the king, the reference solution fails to identify the position as check.

    With board
    |---|---|---|---|---|---|---|---|
    | | | | | | | | |
    |---|---|---|---|---|---|---|---|
    | | | | | | | | |
    |---|---|---|---|---|---|---|---|
    | | | | | | | | |
    |---|---|---|---|---|---|---|---|
    | | | | | | | | ♔ |
    |---|---|---|---|---|---|---|---|
    | | | | | | | | ♜ |
    |---|---|---|---|---|---|---|---|
    | | | | | | | | |
    |---|---|---|---|---|---|---|---|
    | | | | | | | | |
    |---|---|---|---|---|---|---|---|
    | | | | | | | | |
    |---|---|---|---|---|---|---|---|
    Expected
    : true
    to equal
    : false

  • Loading more items...