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.
Sample tests shouldn't be randomized.
I think it would be nice if description mentioned whether it is possible/guaranteed that history entries do/don't span beyond the winning point. For example, I think it should be explicitly mentioned if following input is possible:
[0,3,1,4,2,5]
. Unless you consider such game invalid, which IMO is arguable ;)X: 246.
Don't understand why...
History 0,1,2,3,4,5,7,8,6. Expected result: X_WIN Actual result: NO_WINNER
X - 0,2,4,7,6 (not a winner)
O - 1,3,5,8 (not a winner)
012
345
678
This comment is hidden because it contains spoiler information about the solution
ok, approved.
I modified the sample tests so that they do not contain all the combinations and modified the nested class in the test cases so that it will be private and its properties protected.
ok, resolving.
@Blind4Basics Good question! :) Yes in fact the test class seems to be in the same package as the solution class, so the public method and class were accessible from the solution class. I have now made them non-public to prevent this. I wonder how many more devious ways there are to cheat this thing? :)
that was a question! ;)
@Blind4Basics How would test methods being public be a problem?
Edited to shuffle the collection of test cases before testing them. Wouldn't want anyone cheating :)
OK added vector tag.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
DRY! ;o