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.
Ah okay. Thanks.
I just noticed that the Beta Status for this kata still says 'Testing and feedback needed'. I thought I had taken care of the testing on this, but please do let me know if there is something else required. Thanks.
Got it. Thanks again for all your help.
Wow, thank you for taking the time to write all that. So let me make sure I get this: because arrays are passed by reference in JavaScript, modifications to the array from within the function will of course also change the array from outside of the function. So I should pass in deep copies of the array using the slice function. Is that correct?
Hi again. My background is with Java so I'm pretty familiar with OOP. I was speaking from the point of view of encapsulation. Having said that, the properties in my JavaScript version are public so I suppose I've no cause to question the public variables in your translation!
Thanks for the link on C# naming guidelines. I didn't know they differed from Java in that way.
Hiya. I hope this doesn't come across as pedantic, and I'm not that familiar with C#, but should the variable names be public and starting with a capital letter? Or are getters & setters considered to be overkill for this kind of challenge? Thought I'd better check what I was approving first!
I'm not sure what to do about that. Is it always necessary to have random tests when writing a kata?
Hmmm. I'm not quite sure what you mean by 'vulnerable to input modification'.
I have basically randomized the number of 'matches' that are passed into the function.
It's probably considered hacky, but this is the test that I wrote:
for (let i = 0; i < 200; i++) {
let matches = [];
let limit = Math.floor(Math.random() * 20)
for (let j = 0; j < limit; j++) {
matches.push(['C1','C2']);
}
Test.assertDeepEquals(contestantSwapper(matches), contestantSwapperCheck(matches));
}
Brilliant. Thank you!
Thank you!
Thanks!
Ah yes, I initially had a different idea for the weight of the tennis balls and didn't update that test accordingly. I've since removed that test and updated the methods called on the Test object. Many thanks.
Thanks for the feedback! Random tests have now been added.