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.
As of 2024 ~~ 10 years later, your solution passes the kata, closing ! ^^
The kata needs random tests.
I am getting a weird error when trying to submit my solution and the error is not very descriptive
There should be a test that checks to see if you created the deck correctly since they specify the type of deck. (Or maybe they should make it for us since the shuffling seems to be what this kata is testing) Your kata will still pass if 'dog' is a card.
Also, since it is a little unclear, here is hint: if someone inputs a cheatcode number it should have the same output every single time that cheatcode is put in. HOWEVER, the output for a different cheatcode should not be the same as any other cheatcode number. 6 should not give the same deck as 8 and so on.
What's the difference between a "semi-random" and "random" generator? The logic is not well-defined.
It would be nice if this kata description would be more elaborate and had some examples, especially the part that two different cheat codes should produce two different outputs wasn't exactly obvious.
Somehow I keep not passing the last test. The worst part is not knowing what excatly I got wrong. You should consider adding descriptions to your tests
Ok, I'm back. Based on what I thought I understood from your test cases (because your description still needs an overhaul, but we'll get there eventually), I rebuilt my code completely and I'm pretty confident of it. However there are still some things I can't figure out. Here is a drawing of your third test case :
http://imageshack.com/a/img911/5453/GuK6y1.png
Your test expects five triangles - which I assume are the four ones filled with yellow in the drawing and the large one. Why not the central one ? [[3, 2], [2, 1], [4, 1]] ? It's a perfectly valid triangle, indeed formed with the existing edges of other triangles but so is the large one formed; so why aren't you counting the central (white) one ?
Now this one's a challenge. Only one time this has been completed! It took me a couple of hours, a couple of rewrites and some drawing to FINALLY understand what this kata wants. And since a picture is worth a thousand words, I thought I'd post here a plot of your sixth test, maybe it'll help some people see and understand things better. And, indeed, after counting them one by one, I concur : there's 27 of them :P
http://imageshack.com/a/img908/6504/lJpkYM.png
(P.S. Just because I understand the instructions now doesn't mean I've solved it :P I'll have another crack at it tomorrow.)
Nice test, I will look into adding it. Thanks, I will also update the description with your comments.
Alright, so
cheatCode
does indeed function as seed for our RNG - thanks :)Description should be a little more explicit. Ex: showing an extract of the card array:
["As","Ah","Ac", ...
Randomness of the deck can be tested by looking how much cards are followed by a sibling (of value or suits). if this is 5 times > 50%, there is an obvious shuffle problem
Thanks!!!
That was fun!
Basically if I pass in a numeric cheat code like '6', the deck should be shuffled the same way everytime a '6' is passed in. But a deck with a cheatcode of 5 would not match a deck with a 6 cheat code.
Loading more items...