6 kyu
Combinator Flip
3,394 of 3,428JTipp
Loading description...
Functional Programming
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.
I think there something wrong with the tests. Would be nice to know what function "rev" does. Ps. Well there was more than 2 arguments... Didn't know.
This comment has been hidden.
You're already 6k so you can edit this published kata, and it's not >500 solves either.
hi everyone, I don't have a very high level of Javascript (at all) and it's the first time I see something like "flip(print)(4,5)" ... I don't understand what is (print), why the function is not just flip(4,5) ? Some could explain pretty please ? The fact that there are 2 parentheses after the function is confusing to me.
Here u need to know about currying
Can't get too far in this kata, with the "Value is not what was expected" messages. They're not that useful for debugging code. Particularly, I'm trying to pass the second test. I've replicated the test, and pass it fine, so can't figure out why I'm not passing the real one.
Would really like some help on this; I've got most of the way there...
Are you trying to solve this using eval? I am currently (unsuccessfully) attempting such a solution.
You can do. I've gone the
new Function
route, myself.I revised the testing methods to
Test.assertEquals
. If you're still having trouble finding a solution please let me know. I'll be checking this kata everyday. I don't want to spoil the solution. I will say that of all the solutions I've seen, none of them involve the methods you guys have just mentioned.This comment has been hidden.
For you test cases, you should use:
Thanks, yeah I am new to making katas. I wasn't sure how the testing library works.
Still getting a the unhelpful "Value is not what was expected" messages. Would love some help on this so I can complete the kata. As a hint, try using the form
Test.assertEquals(resultingValue, expectedValue, message);
, as this will at least give a hint of what the problem may be.Hey wthit56, sorry I've taken so long to respond, I've had a busy month and totally forgot about this kata. I changed the tests from
Test.expects
toTest.assertEquals
.Hopefully it will make it easier to revise your solution. The solution is quite simple, I'm sure you will get it. I'd rather not say much about it until you try it out using the new test methods. If you still have trouble I will give a better example.