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.
In the description of Kata must be info, that it could be more moves after winning move.
Its arguinging whos solution is more understandable) Lets do some refactoring and compare our solutions for clearing.
I think my solution is faster
and...?
Dont see 4 loops everyday))) And your solution not very efficient, if I understand your solutin correct, its O(n2), isnt it?
I think that randomTest and atleast fourthTest is wrong because, by the rules, game MUST BE STOPPED when either red or yellow player win. So no new moves. But in test fourthTest and randomTest there are moves after winning move and I think that its incorrect. For example in test fourthTest, move 22 (E_Red) is winning move for RED (two diagonals), but game continues. So IMHO - or you dont allow moves after winning move(wich is corect by the rules because it is the end of the game), or, atleast, in the description of Kata must be info, that it could be moves after winning move.
Some crazy solution
Add massages when fails with playerNumber and wrong path. Also add field input in error massage when fails
Added loop for random test for 123 loops
I add some Pseudo Random test. Its not 100% random but prety close to. I also change back testCases to show error in answer if failed.
Change ouput from String to int[]. Also change testCases not to show correct answer if failed.
I have changed spec to be more clear about input.
Was: The input is the result of the game in the form of an array.
Now: The input is the resulted field of the ended game(so either first or second player wins) in the form of an array.
I thought that return type is just what you prefer.
Thats cant be. Its always somebody win.
дуже файно