Retired

Apparel Shift (Weekend Edition Puzzle of the Week) (retired)

Description
Loading description...
Puzzles
Games
Arrays
Data Types
View
AllIssues4QuestionsSuggestionsShow Resolved
  • Please sign in or sign up to leave a comment.
  • jessnology Avatar

    Okay. I took all of your advice and made a "real programming exercise" based on this idea. It uses random input and cannot be hard coded.

    https://www.codewars.com/kata/find-the-shifted-words

    Please let me know what can be improved. Hopefully this one will make it out of beta.

  • FArekkusu Avatar

    The description doesn't explain the task correctly.

    • Unnamed Avatar

      Any specific suggestions? Looks correct to me.

    • FArekkusu Avatar

      IMO the description is really hard to understand. Only thanks to Chrono's comment I managed to figure out that you have to process an 8-characters-long word, search for resulting 6-characters-long word in the array, and if it can be found return both words. A list of direct instructions would help a lot more than you're given an array... find a pair of words which solve the puzzle... imagine you process a word... you'll get another word. What is it?.

    • jessnology Avatar

      I edited it to make the directions more clear.

      Issue marked resolved by jessnology 6 years ago
  • FArekkusu Avatar

    You should never use Test.expect unless you know what you're doing. Currently it's unknown what you're testing, and looking at the tests structure I assume you don't even know how to write tests properly.

    • Chrono79 Avatar

      The array exists, but only in the Attempt tests. Still, no arguments and it's not clear what to return: an array with 2 subarrays? The 3rd error message is not helpful at all. Do we need an argument in the function?

    • FArekkusu Avatar

      It seems you saw my comment before I edited it, I've figured out that array exists on attempt only.

      The 3rd error message is not helpful at all

      You don't have to write random tests if your fixed tests are already impossible to pass.

    • Chrono79 Avatar

      I think I'm starting to get what the author wants, return an array with the 8 letters word that after the mentioned transformation becomes a 6 letter word present in the array (this one is the second element of the returned array.)

    • FArekkusu Avatar

      Do we need an argument in the function

      Nope, function apparelShift(...args) {console.log(args);} prints [].

      Nothing makes any sense about this kata :\

    • FArekkusu Avatar

      Now I see why Test.expect was used...

      Issue marked resolved by FArekkusu 6 years ago
    • Unnamed Avatar

      It's solvable, an array of 2 words should be returned as specified. All the expects have custom messages, so under the condition that there's only 1 fixed test it's not an issue. A more general question is whether this testing format is acceptable at all. There's only 1 fixed test, so theoretically it can be solved manually and the answer can be hardcoded, although the input is large enough to discourage solving manually. I don't really like this, but I can't decide if it can be accepted as 8 kyu or not.

    • jessnology Avatar

      There is only one fixed test and the answer can be hard coded because there's only one answer. Most people who figured out the original puzzle on NPR probably didn't write a program to solve it...I did, so I turned it into a kata.

    • JohanWiltink Avatar

      It's not conceptually different from asking, say, "what is the second prime number?".

      I don't think that makes for a good kata. It's not that hard to generate random arrays that could be passed as an argument instead of the standard global variable, and turn this into a real programming exercise.

  • Unnamed Avatar

    There's no function arguments, ARTICLES_OF_APPAREL or any other source of input.

  • Unnamed Avatar

    The initial solution is left default.