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.
Removed random tests for now, I didn't write them so don't know how to resolve them
I saw that the last "random tests broken" issue has been flagged as resolved, though it isn't: the random tests feed already dead "entities" in the algorithm, though they are kept by the tester's algorithm.
e.g:
hero: [[3, 4], [2, 0]]
,opponent: [[1, 2]]
Result from the internal algorithm:
hero: [[3, 2], [2, 0]]
,opponent: []
Possible result from the user, filtering the dead entities afterwars:
hero: [[3, 2]]
,opponent: []
Solution would be to not feed in dead entities
Awesome, ok. Thanks for the great info!
I'm not sure to be honest. There might(?) be something in the wiki somewhere, but I think most people just pick it up by looking at other kata (this one's probably not a great one to learn from; I got almost no sleep last night and was pretty lazy with how I wrote the tests, they're not that readable.)
But basically all you've got to do is generate random data within the confines of your specification and test it against the solution and the user's solution. Make sure to evaluate it with yours first (assuming your solution is a 'pure' function) so that the user can't mutate the input before it gets to your function. (Also, never use global variables in your test suite unless you mean to, as they can become available to users).
Usually it's no more difficult than writing basic tests, although sometimes it can be more challenging than solving the kata itself :)
Ah nice. Hmm are there any resources I can look at so I can write these for future katas?
Random tests are mostly just meant to make it so you can't hard-code answers. The ones I added just test different combinations of cards (different numbers of cards, with different stats).
Hi guys,
Sorry this is my first Kata. What are the random tests that you have added, and what do they test?
I'm trying to stay as true to the game as possible, where you fight for the board by trading minions.
As for the test descriptions, yeah I wasn't too sure about what the best practices are, but from my own experience of doing some katas I found it confusing to know which tests were failing and/or what they were even testing.
Thanks for the feedback, really appreciate it!
Good job, now you fix them as well.
Random tests are broken.
added
Are they really called "trades"? Strikes me as a bit funny, since it seems more like a battle/attack.
Also, you might not want a separate test description for every single test you've got in there.
Cases with
undefined
andnull
were removed.No random tests.
Hi,
Yes I was a bit unsure about the 'edge cases', and your right about them, they're rather pointless so I'll remove them. I was going to add error handling too but was thinking that exact same thing abut not focusing on the main task.
Thanks for the feedback on different array lengths, I'll add that in the description!
Loading more items...