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.
Like this one! Performant & readable. I didn't realize there's such relation between the leg length and the direction :)
Yeah, superb that someone made a benchmark on this :) I would say that the results confirm the idea that just simply filling in the 1-s "in a spiral" should be faster than doing some more complex operations with lists etc. (as can be seen in some other solutions). Moreover, for me, this solution is maybe the most readable / comprehensible... :)
I did some benchmarking using node for ~10 of the higher rated solutions on this problem currently, this one and the one by SupraDeus would seem to run by far the fastest of those I checked (this one is seemingly a bit faster for smaller spirals, and a bit slower on larger ones compared to SupraDeus's based on my limited tests).
Anyways, food for thought.
wat
I keep getting one single error in final tests when comparing Ace of Hearts and 10 of Hearts. I've tried making my own tests with same cards and they pass as they should:
Test.expect(new Card(Card.HEARTS, 1) > new Card(Card.HEARTS, 10)); => Test Passed;
Test.expect(new Card(Card.HEARTS, 1) < new Card(Card.HEARTS, 10)); => Value is not what was expected;
Test.expect(new Card(Card.HEARTS, 1) == new Card(Card.HEARTS, 10)); => Value is not what was expected;
All the other comparisons in final test pass as well. Is there something wrong with final tests?
Is this even javascript?
Was struggling to see the pattern but failed. Yet it was so simple and so beautiful.