Ad
  • Custom User Avatar

    Good kata but test design is annoying. Each test case should have its own it block, and you could enable allow_raise to exit test cases early on first failure

  • Custom User Avatar

    OP solved it, closing

  • Custom User Avatar
  • Custom User Avatar

    In general it's not possible to run random tests locally since they are not available until you solve the kata. Ideally tests logs should be more explicit and give you the input your code fails on. In this kata, NASM tests seem identical to C's tests (on Codewars, afaik NASM tests are always written in C), so if you solved them in the latter you may be able to do something useful locally.

  • Custom User Avatar

    My NASM solution passes Sample and Basic tests, but fails with "Signal code: 11" on Random_Tests_1000_strings_of_65635_char

    If I understand correctly these tests run various 65635-long strings 1000 times? How could I possibly test something like this by myself?

  • Custom User Avatar

    Hi,

    just actually put the fixed tests in the sample tests. No user will try to debug their code with random parameters in the sample tests, expecially because the user doesn't know what your function helper is doing exactly. So actual fixed test are way more useful.

  • Custom User Avatar

    Okay :c
    It's not first Shell kata with same problem for me – optimization
    Will unlock solutions then, maybe I don't know some crucial tools for such problems
    Thank you for kata, I really enjoyed it :з

  • Custom User Avatar

    Sorry, the time out is fixed by CW. Furthermore I can't reduce the tests when some people are timing out...
    11 people passed the Shell kata so it's doable in the given time. There is a solution that takes 1275 ms and there are some below 2000 ms. Cheers.

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    Wow! Because of this even legit but not optimal solutions are invalidated!

    (*・‿・)ノ⌒*:・゚✧・゚✧・゚✧・゚✧・゚✧・゚✧・゚✧
                ✧・゚✧magic of coding・゚✧・゚
                ・゚✧・゚✧・゚✧・゚✧・゚✧・゚✧・゚✧
    
  • Custom User Avatar

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

  • Custom User Avatar
    1. Added postmortem log. Looks like this:
    Amoeba died from starvation :c
    ~~~~~~HELP IN DEBUGGING~~~~~~
    
    You've reached maximum amount of iterations: 20
    Here is how maze looked like at start:
    52 58 64 || :: 
    46 || 70 || 94 
    40 || 76 82 88 
    34 || || || || 
    ~* 22 16 10 04 
    Here is how it looks at the end:
    52 58 64 || :: 
    46 || 70 || 94 
    40 || 76 82 88 
    34 || || || || 
    ~* 22 16 10 04 
    You could debug this maze by putting following list in "maze" parameter in test_amoeba_brain():
    [[0, 0, 0, 1, 3], [0, 1, 0, 1, 0], [0, 1, 0, 0, 0], [0, 1, 1, 1, 1], [2, 0, 0, 0, 0]]
    
    1. Now user able to provide maze map that looks like this:
    maze = [
        [0, 0, 3],
        [0, 1, 1],
        [0, 1, 2]
    ]
    # 0 - empty, 1, wall, 2 -amoeba, 3 - food
    

    More than this - user can copy-paste initial maze structure from postmortem log and try it in sample test.

    Added all this in the description of kata.

  • Custom User Avatar
  • Loading more items...