Ad
  • Custom User Avatar

    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.

  • Default User Avatar

    Thanks for that, I moved my return to the wrong location while debugging a different problem. All solved now.

  • Default User Avatar

    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.

  • Default User Avatar

    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:

     Log 1
    Characters: SWPSDG
        Value to match: 84
    
    Character: S Value: 83
    Character: W Value: 87
    Character: P Value: 80
    Character: S Value: 83
    Character: D Value: 68
    Character: G Value: 71
    
    Matches to Win: 2
    Total Matches:  0
    Loser!
    Expected: "Winner!", instead got: "Loser!"
    
     Log 2
    Characters: XS
        Value to match: 62
    
    Character: X Value: 88
    Character: S Value: 83
    
    Matches to Win: 3
    Total Matches:  0
    Loser!
    Expected: "Winner!", instead got: "Loser!"
    
  • Default User Avatar

    This is really incredible.

  • Default User Avatar

    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:

    1. ignore a false which is proceded by a true
    2. award points to the non serving player on a double false
    3. award ponts to the serving player on a true, false
    4. ignore a double true
      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.

  • Default User Avatar
  • Default User Avatar

    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

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution