Description could be interpretted as one line of code or one line in the answer. Please adjust description to specify one line of code.
Although it's been raised before, but the Ruby restriction of using flat_map is neither necessary, nor is it properly checked: see this solution
JS : expected/actual are swapped at some places in the test suite (I don't know where exactly, see message just below)
just the expected and acual that are swapped in the code. Yours is in "expected". ;)
sonething is wrong with this kata i just inserted and empty array wtih 52 elements and after that i hitted atempt and on the last test i got:
Expected: [, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ], instead got: ['ace of clubs', 'ace of diamonds', 'ace of hearts', 'ace of spades', 'eight of clubs', 'eight of diamonds', 'eight of hearts', 'eight of spades', 'five of clubs', 'five of diamonds', 'five of hearts', 'five of spades', 'four of clubs', 'four of diamonds', 'four of hearts', 'four of spades', 'jack of clubs', 'jack of diamonds', 'jack of hearts', 'jack of spades', 'king of clubs', 'king of diamonds', 'king of hearts', 'king of spades', 'nine of clubs', 'nine of diamonds', 'nine of hearts', 'nine of spades', 'queen of clubs', 'queen of diamonds', 'queen of hearts', 'queen of spades', 'seven of clubs', 'seven of diamonds', 'seven of hearts', 'seven of spades', 'six of clubs', 'six of diamonds', 'six of hearts', 'six of spades', 'ten of clubs', 'ten of diamonds', 'ten of hearts', 'ten of spades', 'three of clubs', 'three of diamonds', 'three of hearts', 'three of spades', 'two of clubs', 'two of diamonds', 'two of hearts', 'two of spades']
this test expects and empty array and i got an array of items what is wrong with this??
This was a nice kata. I've never done lamdas before but I was able to figure it out
As others have pointed out, the "1 line" constraint could have been expressed or enforced differently. I assume the author wanted to enforce a single expression / ban iterative solutions.
In C# the description calls for "ace of hearts" but the tests look for "hearts of ace". I think it's important that these match, and would recommend updating the test (who says "hearts of ace"?)
Normally I don't like to do these kind of public shaming sessions, but sometimes it just has to be done.
Please learn to write proper and clean code and don't cause hassles to everyone else by writing faulty translations.
Ruby: The actual code limit is 4 lines, not 3.
Also the test used to require that the cards are in order.
I decided to release this requirement. It shouldn't affect the solution approach anyways.