7 kyu
Playing Cards Draw Order – Part 1
113 of 1,071Zwyx
Loading description...
Mathematics
Games
Permutations
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Scala translation
Thank you!
All the test expects is null
Is this not a duplicate of https://www.codewars.com/kata/573c84bf0addf9568d001299?
Oh wow yes it basically is! Funny that they have different ranking ;-)
This comment has been hidden.
This comment has been hidden.
ALL LANGUAGES except Python:
There should be a sample and fixed test with empty deck
Random tests should use decks of random length
CS added empty test and random tests are now randomly random long
Same with Java
The point of this kata is to find and code the required algorithm, not to create a production-grade application. Moreover, if you succeed to write a code that exploits the fact that deck lengths aren't rendom, instead of simply writing the very simple expected algorithm... well, you really deserve to pass this 7kyu kata :-)
Description should be language-agnostic
CS is inconsistent with other languages,
Expected: [undefined], instead got: []
Fixed when random length became random
nope! I still get the error in random tests, is your ref solution correct?
splicing an empty array results in this undefined
In Java testSample() test expected and actual values are swapped.
Fixed
not fixed.
Java translation
Thank you!
Please see issue above!
CoffeeScript translation
Thank you!
Please see issue above!
Python translation: https://www.codewars.com/kumite/645d751cd355a30043cb143b?sel=645d751cd355a30043cb143b
Thank you!
Hi Mauro, the point of this kata is to find and code the required algorithm, not to create a production-grade application.
I would say unnecesery amount of description. But great kata tho.
chai.config.truncateThreshold
is not set to0
, so failed assertion looks likeexpected [ Array(8) ] to deeply equal [ Array(8) ]
and hides all useful information.Thanks for that! Fixed now.
Is there something wrong with the deck? Why is the expected result an empty array?
Okay, I figured out the issue. If the solution modifies the deck, it breaks that very first random test somehow. Perhaps the test should pass a copy of the deck to the solution instead of the original.
Thanks very much for letting me know. That was indeed a mistake on my behalf that would have allowed cheating.
Fixed now!