Ad
  • Custom User Avatar

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

  • Custom User Avatar

    Rock, Paper, Scissors without conditional logic.

  • Custom User Avatar

    And remember, 5am coding leads to erroneously calling a variable the "mean" when it clearly isn't divided by the number of values.

  • Custom User Avatar

    Oh man, looks like I skim-read the instructions and ended up bringing the pepper shaker instead of the salt. I should have paid more attention to that second drawn matrix, rather than looking at the first three elements and thinking "yeah I get it". I've finished the code for real now, and it's now a lot cleaner. Great kata and thank you both for the information.

  • Custom User Avatar

    I've written a function which I am almost certain should solve this kata, but I am having a couple of issues.

    If I click "Test", I get a failure message as the sample test which includes a 36-element array seems to want the numbers in ascending numerical order [1, 2, 3, 4, 5, 6, 7, 8, ..., 36] rather than the actual spiral pattern of [1, 2, 3, 4, 5, 6, 12, 18, 24, 30, 36, 35, 34, ..., 21].

    However, even if I hard code in an ascending numerical order for 36 elements, I am having an issue when I click "Attempt", where the numbers in the given array are not 1 to n, but instead seemingly random unordered numbers, such as [793, 58, 556, 635, 246, ..., 385].