Ad
  • Default User Avatar

    Hahaha, I wrote that comment 3 years ago! I resat the kata and tried again, this time with no hiccups.

  • Custom User Avatar

    Both Python and JS version needs better handling inside the transition function. Passing in unexpected values just throws an exception.

  • Custom User Avatar

    You passed in a invalid symbol.

  • Custom User Avatar

    Why does JS version have completely different transition function return format? Language versions should have the same mechanism whenever possible.

  • Custom User Avatar

    Hey,
    I did the same way. For me - beginner in python - very easy to to read the code and see what is happening.

  • Custom User Avatar

    Brilliant. I'm so mad I didn't think to see how to convert base 16 in python. This is much cleaner than my solution.

  • Default User Avatar

    I keep getting an error

    TypeError: Cannot read property '9' of undefined
        at transitionFunction (test.js:127:56)
        at machine (test.js:10:50)
        at Context.<anonymous> (test.js:144:21)
    

    when calling the transitionFunction, which is really annoying. My solution works for the given tests and I cannot see what is wrong with me calling the way I do.

  • Default User Avatar

    Need more clarification on what types of attribute access to record.
    For example, I assumed access to init before calling it also needs to be recorded.

  • Default User Avatar

    fixed.
    thanks!

  • Default User Avatar

    minor typos:

    Your mission is to implement a turing machine emulator.

    For more information about turing machine: https://en.wikipedia.org/wiki/Turing_machine

    Turing is a proper noun, ao should have a capital T

    Operations to take using the trasition function

    transition

    new_symbol - A charachter to write at the current position

    character

  • Default User Avatar

    done

  • Default User Avatar

    noted.
    done

  • Default User Avatar

    done

  • Custom User Avatar

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

  • Custom User Avatar

    ( JS )

    T[[s,q]] = ...

    This. Is. Horrible.

    Object property keys can only be Strings. This syntax is valid, it's very, very Clever, and it relies on implicit coercion and it's completely unmaintainable. Also, I don't want to think about what happens when s or q happens to be ','. Or when T is a Map instead of an Object, which might at some point be a desirable optimisation.

    If you understand fully and completely when and how coercion works, and any and all collaborators agree this is a good idea ( with the same deep understanding of coercion ), and this behaviour is extensively, exhaustively documented, you might get away with it as long as nobody else ever needs to maintain your code. ( I would never ever want to be one of those collaborators. ) Given that the platform and the testing framework might at some point get upgraded and require maintenance on your testing code, and you might disappear from CodeWars and some poor sod other than you might have to perform that maintenance, please don't do this. It's begging for bugs, which might leave the kata non-functional at any moment.

  • Loading more items...