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.
Very nice kata, really interesting overall.
this consistenly fails the random tests now
The reference solution implemented the tiebreak rule ("If there is a draw, players with the same score must be presented in alphabetic order") incorrectly. The upgrade to Node 18 exposed it, as the implementation of
Array.prototype.sort()changed (it is stable from Node 12 on), which made the refsol fail the fixed test"whoWon when there's a draw". I tentatively fixed it by replacing:with:
It is very possible that something else is broken, as there were only 6 random tests, so buggy solutions could pass the tests.
This comment is hidden because it contains spoiler information about the solution
Currently, the number of random tests is limited to 6, this is clearly not enough.
This comment is hidden because it contains spoiler information about the solution
Nice One!!!
A lovely kata. It was fun. Is it matter where 'totalLoosers' appears in the winnersList, I mean 'Ben: 23' should go first or 'Jack: 27'. Ideally Ben in this case should go before Jack since its score closer to 21. But at this moment either implementation is allowed ([Jack, Ben] will pass tests).
Approved
Thanks for pointing that out. I've fixed these issues now
Issue: Occasionally with the random tests, a player's card will be given as 'undefined'.
Here's an actual test case that occurred:
{ Ben: '7, 6', Amy: '7, undefined', Sam: '5, 2' } 'Q' [ 'Sam' ]Suggestion: (unrelated to the issue above) In the Description, for the first rule:
The last bit is unnecessary since the maximum hand a player can start with is
20(since Aces cound as10).Thanks for the feedback. I think I have resolved these issues now.
whoWins