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.
Just in case you aren't aware, the reason you are failing that test is because each 3x3 block must contain exactly one of each integer from one to nine. For example, in your hard coded solution, look at board[0][1] and board [1][0], they are both two, board[0][2], board[1][1], and board[2][0] are each three.
Thanks for that, I moved my return to the wrong location while debugging a different problem. All solved now.
I'm passing around 90 tests each time.
Looking at the second log alone: How can I get three matches on only two characters?
Both of these logs show that the values for each character don't match the value needed for a match.
Every test that I'm failing is similar to these two where I return loser but the test is expecting winner.
I figure either I'm missing something or the tests are bad.
Using Ruby for this and I'm not sure where I'm messing up. Here are two Logs from where I'm using puts to print out the various values:
This is really incredible.
I finally passed all of the tests. The problem was with how I was thinking about tennis scoring which resulted in mishandling the array. My solution, which passed all of the static tests and none of the random tests, was:
This resulted in the server always being awarded a game point on any true, false, regardless of how many trues preceded the true, false and the other player could only score a point on a double false.
Example 1: balls={[false, true, true, false, true]}
false > ignore
true, true > ignore
false > ignore
true > implied false > server gets a point
When handled properly:
false, true, true, false > non serving player gets a point
true > implied false > server gets a point
I don't know if you need to add a test for this, but a test like the following would have caught me early on:
balls={[true, true, false]}
balls={[true, true, true, true, false]}
These are essentially representing a volley in which the non serving player scores a point, which is never tested for until the random tests.
I am using Ruby.
My code passes all of the standard tests but none of the random tests. I took the list of balls values and manually parsed them to determine points and compared that to what my solution comes up with and what the test case is asking for. My code comes up with the same results as I do, which tells me that my code is doing exactly what I want it to do based on my understanding of the problem. Obviously I'm not understanding something about how to assess the points earned.
Considering that the tests are quite lengthy and my code isn't short either, what is the best way for me to get some direction here? Should I just post the true false values of one of the tests I am failing and add in my notes as to how I am assigning points, determining game wins, switching who serves, handling deuce and advantages? Should I share my code?
Thanks
This comment is hidden because it contains spoiler information about the solution