Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Any updates on this issue?
afaik you can't edit test cases if 500+ warriors passed them.
Once the kata has been completed 500+ times it can no longer be edited except by admins - in order to prevent the kata from breaking everyone's solutions after it became popular. What were you looking to change?
It's probably bug in codewars (or in some specific library version). You should report it.
Could you please change the assertion to this form, so we can submit our solutions:
Thanks
Well the root cause is extra 'e' in your assertion. When I run it outside codewars I get:
But I don't know, why it doesn't show the correct output here.
FYI: if you use assertThat notation, it works OK ;)
Ahh... it's because I didn't set the random number generator to use non-negative numbers
I added randomized testing to your other kata as an example, btw.
Haskell makes this much easier than other languages, IMHO, and it's a great practice for testing actualy production code.
BTW, as far as I can tell, you can generate credit card numbers by simply incrementing the final digit given an odd number of digits.
It's okay, btw, if you don't know QuickCheck. It's something you only start to learn after doing Haskell for a while. But you can see my other kata where I use it.
http://www.getcreditcardnumbers.com/
Anyway, I added randomized testing... so your hacky solution probably shouldn't work.
QuickCheck supports rejection sampling, so for small input it should be possible to use a reference solution to force valid input/invalid input, but for now I just check that the users input matches the reference solution for a wide input range.
Hmm... fair enough.
I see why you occluded a bunch of the tests now. I'll go update the kata framework.
It's a bit of a pitty you didn't implement the actual Luhn algorithm, we could just generate valid/invalid CC numbers.
just to mark resolved
I wanted it to be like some additional kind of puzzle with this kata, but you are right, this can be confusing, starter fixed
Glad you liked it. :-)
I'll be sure to update the solution.
Thanks for the nice kata!
Errors like this are usually a case of incorrect type. Are you returning a string?
You are right that BFS will return the first path it finds, but by nature of BFS and the fact that there are no edge weights, that will be the shortest path.
Although my math is not strong enough to outline a proof [ :-) ], I have pretty high confidence level that BFS will always work.
BTW, I used BFS for my solution and it passed all your tests. I'd be interested in seeing a map where BFS does not work...
Loading more items...