Beta

Snake Draft

Description
Loading description...
Arrays
Fundamentals
View
AllIssues2QuestionsSuggestions1Show Resolved
  • Please sign in or sign up to leave a comment.
  • danik00111 Avatar

    This comment has been hidden.

    • B1ts Avatar

      Yeah, that wouldn't really fix the problem... const in JS doesn't mean what you think it does.

    • danik00111 Avatar

      what would then?

    • B1ts Avatar

      This comment has been hidden.

    • B1ts Avatar

      See above. I marked it as spoiler just in case. The "issue" seems to come from your code.

      Issue marked resolved by B1ts 10 months ago
    • danik00111 Avatar

      This comment has been hidden.

    • B1ts Avatar

      I'm not an oracle, so I don't know. Global variables? Confusion?

      You can always go to Solutions tab and fork any solution, and play around with it. You can modify tests as you see fit (you will notice that adding const doesn't change anything). Tests pass a copy of the array, so the expected result isn't affected by your code.

    • danik00111 Avatar

      no, i figured everything out. i realised exactly what the issue was. see my solution to see how i fixed that

    • B1ts Avatar

      I saw it. My point was that the tests passed the right arrays, and expected results were correct, so the issue wasn't with the kata itself. I agree that every var should be replaced with const / let but that's a minor issue (especially considering that the kata is in beta for 7 or so years).

  • balu9 Avatar

    Poor description! nth pick stands for number of rounds and it also stands for the position of the element you have to return after completing the rounds!

  • JohanWiltink Avatar

    Your random tests are vulnerable to input modification.

    • maskedcoder Avatar

      Thanks for letting me know. I just fixed that, and made the random tests be more random. Your solution should fail most of the tests now.

      Issue marked resolved by maskedcoder 8 years ago
  • matt c Avatar

    I think you need to update your description on how a snake draft is formed after each round for larger sets.

    • maskedcoder Avatar

      Don't snake drafts act the same for larger sets as they do for smaller sets? E.g., abc...xyz, then zyx...cba, then abc...xyz and so on?

      Are the test cases not doing that?

    • Voile Avatar

      The thing is that it's not very clear what nth means:

      list: abcde
      
      nth = 5 -> e
      abcdeedcbaabcde...
          ^
      nth = 9 -> b
      abcdeedcbaabcde...
              ^
      

      nth actually means something like above rather than things like "nth round".

    • maskedcoder Avatar

      I see. I changed nth to nthPick and added a few examples. Does that clear up any confusion?