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.
@JohanWiltink thank you!
@Larissa Have a look. I did for JS what I did for Haskell, mostly. I may have forgotten a failure message here or there, but I think I've done adequate custom messages where the default was not enough ( sometimes it is ).
I'll fix up the JS version some more. I can't do that for Python unfortunately, I don't know enough Python.
There is a difference between 21 and black jack. The test cases are correct. [10, 11] beats [5, 5, 11]
This is stated in the description:
"-Get 21 points on your first two cards (called a blackjack), without a dealer blackjack;"
@JohanWiltink, Thanks for your help, it was much harder than it seemed at first. I will be grateful to you if you help bring everything to a successful conclusion.
Please ask for confirmation that the problem is actually solved before closing issues. You had not solved the issue this user was experiencing. And he really was experiencing an issue.
After factoring out the validation function, it should really also be used for the basic tests. Those are ( still ) a mess.
The JS tests actually did have major problems Larissa. Whenever the expected value was not
null
one of two wrong tests ( boys and girls count were switched ) failed, was caught, and failed the user solution with a generic failure message.I've done some cleaning up, and things should more or less work now. It can still be done cleaner.
It can also be used for Example tests if you factor out the checking function, don't use that for
null
results ( and take that logic out ) and directly test fornull
when appropriate ( that way you don't give away any logic ). There is no need for a reference solution at all except to give a possible solution on failing tests; I think that should still be put back into the failure messages for the current tests. But I wanted correct tests first.random tests test your solution and do not check for an exact match with any particular result. In the tests, it is checked that a string of the desired length is created, that the letters G and B are placed in the order that corresponds to the condition of the problem.
( Assuming JavaScript. This sh!t can be language-dependent - it helps if you say in which language you're having an issue. )
That's what it says, but it's not what it does. The real problem is catching the
AssertionError
s testing is throwing. You're trying to be too smart, author.oh my goodness, I'm definitely not a fan of any of my 3 years old code.