Ad
  • Custom User Avatar

    One floor:

     /\
     —
    /\/\
    

    Four floors:

        /\
        —
       /\/\
       — —
      /\/\/\
      — — —
     /\/\/\/\
     — — — —
    /\/\/\/\/\
    
  • Custom User Avatar

    Practially, it doesn't make any difference. The init method automatically returns none, so you don't need to include that instruction in your code. The 'pass' keyword does nothing, it is basically just a placeholder to keep Python from getting angry that you didn't include an indented block in the init method. If you used an empty return, or return None, you'd get the same results, you're just doing a little more work than you need to.

  • Custom User Avatar

    @moonrhino68, I think that on the pc on which you can use the shortcuts has No Editting Mode Enabled(VIM or ENAC), while on the other pc anyone of them is enabled.

  • Default User Avatar

    No, I think it's the same... if you don't need pi outside the function.

  • Custom User Avatar

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

  • Default User Avatar

    ['gather', 'field', 'wheat'] defines a directional edge, or arrow, which begins at the node called 'field' and terminates at the node called 'wheat'.

    I.e. to get from the 'field' node to the 'wheat' node, that arrow indicates that you could do so directly. However the arrow is one-way; you can't go in the reverse direction unless there's another arrow in the reverse direction.

  • Default User Avatar

    Did you trim the spaces from the end of each line?

  • Custom User Avatar

    Are you in any special mode? (emacs, vim?)

  • Default User Avatar

    The for( var i in arr ) statement coerces i to a string.
    The expected value is a number.
    So the error message "Expected 5, instead got 5" means it expects a 5 not a '5'.
    Modify your for statement, you'll don't need to parseInt the index result.
    (first case passes because index was 0)

  • Default User Avatar

    You need to return a function from the method getSequence, which calculates the 'nth term' for any given value of n.

    So getSequence([1,2,3,4,5])(10) is equal to calling yourNewSequence(10), which should then calculate f(10) for the sequence [1,2,3,4,5].

    Sorry if this isn't very clear!

  • Custom User Avatar

    console.log do work on codewars. The log output is directed to the Output window.