Ad
  • Custom User Avatar

    Your difficulties with solving the kata are not really a kata issue.

  • Custom User Avatar

    Anybody solved the problem in last one in the basic cases in attempts?(in Python)

  • Custom User Avatar

    Yeah, that´s better, now the editor has color, lol.

    Also, nice one on the error message, it´s very helpful.

  • Custom User Avatar

    This felt harder than 6 kyu. I guess it's not so complex but there's a lot of stuff to keep track of that makes it harder.

  • Custom User Avatar
  • Custom User Avatar

    Makes sense, I realised aswell its a bit annoying if you fail the tests because you have no clue what the map looks like unless you have a bunch of print statements so I've:

    • shortened the test cases code by making the medium & large maps as you suggested above

    • added a message if you fail the testcases that will tell you information about the map

  • Custom User Avatar
  • Custom User Avatar

    Adding a message so that if you get the test wrong, it will give information about map, ct, bomb, and kit

  • Custom User Avatar

    I'd say that the visual thing is really nice for the sample tests, where the user can see the map.

    My comment is more focused on making translating the kata easier. The visula aspect is nice for people to gain familiarity with the kata, but if someone is trying to translate it, they probably already got familiar with the problem, so making it more straight foward is better.

    The user won't see the final tests cases anyways, so making is not so visual won't have a great inpact.

    But yeah, changing only the larger ones is totally fine. They are the ones causing the most trouble for readability. The small ones are fine.

  • Custom User Avatar

    I guess I wanted it to be more visual but you are right once the array gets really large it becomes unreadable.

    I'll keep the small tests as is but change the medium and large ones

  • Custom User Avatar

    Nice one, if only defusing the bomb was this simple on the real game...

    Also, in the test cases, why don't you initialize the array to all '0' and then set the other positions individually? Something like:

    _map = [['0'] * width] * height
    _map[i1][j1] = 'CT'
    _map[i2][j2] = 'B'
    _map[i3][j3] = 'K'
    

    I feel like it would be more readable than having a huge array hardcoded in the tests.

  • Default User Avatar
    def bomb_has_been_planted(matrix, time):
        for row in matrix:
            print(row)
        print(f'\ntime = {time}\n')  
    
  • Custom User Avatar

    How can I solve the problem without knowing problem in attemps?
    (there is info about maps in attemps)

  • Custom User Avatar

    Description does not ask you to return equal. It specifies to return the modified string except when the final string is longer than 140 chars / empty , or when the original input is already empty.

    Your code, OTOH, returns equal for final strings of length 140, modified string for lengths less than 140 and False for other cases.

  • Custom User Avatar

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