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.
A dialog poped up asking for feedback, I clicked minor things and then typed this in. There is no reason for some polish before it goes out of beta.
The C# stub variable names should match the description names a1, a2
The problem description should be improved (at least on the javascript version), the problem talks about 0's and .'s, but the solution doesn't use strings, but requires 1's and 0's. At the bare minimum change the example to use 1 rather than 0. There is no reason why the javascript solution can't include the test case presented in the description. And lastly the tests should convert to a string representation (aka it will look like a box) rather than a list of arrays which is just making it slightly harder for everyone for no reason. Lastly the wording "General rule-of-a-thumb is, that the snake made with '1' cannot touch to itself." This should be changed to explicitly state that "A snake can never touch itself". General rule-of-a-thumb sounds vuage and optional. At least the JS version feels like a beta kata and should just get a quick cleanup.
Something as simple as adding an API to get a list of all members of a clan we could then query each member and generate our own leader board to print out and post up weekly or whatnot which would I expect be good enough to attract and keep interest.
You have Array.prototype.range
I can't edit it anymore, here are more descriptive tests
Test.expect(arraysEqual(Array.range(0,0), []), 'A count of 0 should make an empty array')
Test.expect(arraysEqual(Array.range(0,1), [0]), 'A count of 1 should make an array with 1')
Test.expect(arraysEqual(Array.range(-1,1), [-1]), 'The array's first value should begin with start (aka range(-1,1) should return [-1])')
Test.expect(arraysEqual(Array.range(1,1), [1]), 'The array's first value should begin with start (aka range(1,1) should return [1]')
Test.expect(arraysEqual(Array.range(-1,3), [-1,0,1]), 'Testing count (aka range(-1,3) should be [-1,0,1])')
Test.expect([].sum() == 0, 'empty array should sum to 0')
Test.expect([0, 1, 2].sum() == 3, '[0,1,2] should equal 3')
Test.expect([-1, 0, 1].sum() == 0, 'Adding negative numbers')
Test.expect([1, 2, 3].sum() == 6, '[1,2,3] should equal 6')
You don't want range in the template. The template had:
Array.range = function(start, count) {
return [];
}
@ophinjay hmm any more information, all of the tests have descriptions so you should have got some sort of error message tell you what was wrong.
Glad you spotted your bug :) Any way the description or tests could be improved for others?
@mrkishi yes of course that would do it, done
@mrkishi good catch, any suggestions on a better arraysEqual?
Oh good point I will clarify that point.
Well there is the test:
Test.expect(arraysEqual(Array.range(0,0), []), 'A count of 0 should make an empty array')
Yeah the discription could be better, i'll tweak that
@markrozencwajg, reduce has an optional initial value argument
Loading more items...