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.
It looks like we are expected to include a .equals method as well even though it is not specified.
This comment is hidden because it contains spoiler information about the solution
There is no test written for the JS version and the submit button only checks one case. So still substantially incomplete.
Only the first player gets the freedom to pick any of the 3 numbers. The first move of the second player is subject to the restriction. So if you start with 2 cakes and volunteer to play first, picking 1 will stalemate your opponent and you are forced to eat the last cake.
Nice commenting. It helps understand the though behind the implementation.
My implementation suffered from some rounding issues due to the double number type. All the test cases still seem to be integers but I did not want to break the possibility of it working with non-integers.
Anyway I ended up doing some slightly ugly casting to C# decimal and back at critical points where I thought the rounding error might be occurring. This did not seem to penalize performance much and it passed the tests.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution