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.
.Length returns the total length of the string starting from 1. We need to access the index which begins at 0. If we wanted to access the last index of the original string it would be Length-1. Since we want to cut the last character off, we use -2. Hope that helps
C:
const int[24]
C:
const int[16]
Important!
Error could say - wrong sorted result, but actually it could be wrong math calculation. Spent a lot of time.
not a kata suggestion
It's been veeery long ago :-))) Thank you for explaining the rule book, @B1ts! ๐
Have you played poker? :P In this case it's point #3. 5 cards are involved in final ranking, and in this case it's the last card that matters (5 > 4), as the pair and 2/3 high cards were equal (suit doesn't matter in this example).
Poker question no. 1:
it("Highest pair wins", function() { assert(Result.loss, "6S AD 7H 4S AS", "AH AC 5H 6H 7S");});
--> Is this an error in the test cases? (the pair is equal: both have a pair of aces)
--> Is this saying that only in case of an equal pair, the suit is relevant? (clubs beats spades)
--> Is this saying that in case of an equal pair, the highest card is deciding? (5 beats 4)
Ohhhh, thanks, nice explanation
If you pass 0 to the function, it will return -0 yes, but when you try to display -0 (for example, with console.log(-0)), it will appear as 0. This is because JavaScript generally doesn't distinguish between 0 and -0 in the output.
Go preloaded tests are not quite right. It doesn't correctly pick up the set variables
clues
andexpected
. I assume because the examples run after all lines of the Describe are evaluated, so the way it's done it only runs with last clues and examples. Could we move setting these variables inside theIt
?I forgot to account for ace-low straights, but I still passed the tests. Maybe that should be stricter.
Never in this kata is it mentioned you're in a game. You just need to compare 2 hands against eachother.
having the same issue
image is broken in the description.
Loading more items...