7 kyu
Sentences with Functions
3,328 of 3,458BattleRattle
Loading description...
Fundamentals
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.
This Kata doesn't make sense. We don't want to learn how to code to make predetermined things, but to take care of unpredictable ones. Don't lose your time with this Kata, really, you won't learn much to put in practice in real life.
This comment has been hidden.
this kata disgusts me and letting you all know makes me feel better
This comment has been hidden.
This comment has been hidden.
The test suite is lacking, it isn't a cheat.
Awesome solution xD
The test suite is not lacking and that is not a cheat. Read the specifications carefully.
I am getting stuck, is it necessary to have arguments with every function listed? I think I am headed in the right direction when I use:
return arguments.callee.name;
Although I am also thinking I can just split the '(' in Adam and The functions?
Can anyone help me into at least leading me in the right direction instead of bashing my head on the keyboard, please! Thanks.
I got close with using
return name += ' ' + arguments.callee.name;
but its in reverse!
It's been ten years. Closing.
problems like this are kind of annoying - you'd never want to pollute the global namespace with functions like that.
I think it meant more for out of the box thinking. Try to make you think of the language a little bit differently. If anyone ever actually did this in production code that would just be insane.
thanks for the reply - I see what you mean
This is a tremendous example of KISS...
This actually made me think alot!!! :D
This comment has been hidden.
As already mentioned in other places: it's OK to do it that way, since the description clearly says "in order to create the following sentences", not "any possible sentence". Those solutions simply fulfill the requirements ;)
This comment has been hidden.
This comment has been hidden.
Nice one! 'With many paths to Rome'.
This was tough.
Then you did it wrong. :D
That's not saying your solution is wrong - but anything that passes the tests ( and implements the spec ) is good enough.
I really need to spend more time reading the description...xD
I definitely overthunk this one :-)
Good kata. It would be useful if it returned a better error message than just "value was not what was expected". You could use Test.assertEquals() to do this. Given that the expected value is in the actual description, I could however see the argument that keeping the messaging vague will force users to write their own test cases.
I like that there is an easy way to solve this but its also very open to people taking the time to come up with sophisticated solutions.
You're right, using assertEquals() makes sense here. I changed it.
That was quick turn-around! Its out of beta now.
This is a mean one, I totally stepped into the trap it sets up and thought waaayyy too complicated... :S I like it, teaches to really think about the simplest possible solution... :D
Agreed. Totally.
I'm ok with JS but the whole test thing is brand new.. going to have to do some googling :D
It is a trap in a sense...but really who is going to ask you do call something like that in the real world? In the real world, I always think of the leanest, most efficient way to implement something. I don't see the need to put thought and time into how to code something like Adam(has(a(dog()......
I would never code a solution that had to be called that way anyways. It's nice to see that some people put time and effort into the solution. But this is just the basics, you have to remember that. Just my humble opinion on this stuff.
yeah I agree. It took me so much time to solve the problem and optimize the solution until 'WTF' when I saw the top voted solution hahaha.. Anyway worth it coz I learn so much and I feel I'm still okay with my solution as it really functions so well even the rules change to what it really meant.