Retired
Apparel Shift (Weekend Edition Puzzle of the Week) (retired)
Loading description...
Puzzles
Games
Arrays
Data Types
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
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.
The description doesn't explain the task correctly.
Any specific suggestions? Looks correct to me.
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?
.I edited it to make the directions more clear.
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.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?
It seems you saw my comment before I edited it, I've figured out that array exists on attempt only.
You don't have to write random tests if your fixed tests are already impossible to pass.
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.)
Nope,
function apparelShift(...args) {console.log(args);}
prints[]
.Nothing makes any sense about this kata :\
Now I see why
Test.expect
was used...It's solvable, an array of 2 words should be returned as specified. All the
expect
s 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.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.
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.
There's no function arguments,
ARTICLES_OF_APPAREL
or any other source of input.Woops! First time writing a kata. I think I fixed it.
The initial solution is left default.
Fixed it!