Ad
  • Custom User Avatar

    Maybe things changed since your comment, but you can pass strings as well to test

  • Custom User Avatar

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

  • Custom User Avatar

    Confirming that the "Draw" cases appear to have been corrected! Hooray!!! (And, thanks!)

    (Also, the example above was missing a check for SE to NW diags. Which has also been corrected.)

  • Custom User Avatar

    Second that ^

    7 fail for me. All of the following format:

    Expected: 'Yellow', instead got: 'Draw'

    My code correctly predicts "Draw" but, in all 7 cases, one of the two players is expected (incorrectly.)

    [ [ '', '', '', '', '', '', 'R' ],
    [ '', 'Y', '', 'R', 'R', '', 'Y' ],
    [ '
    ', 'Y', '', 'Y', 'R', '', 'Y' ],
    [ 'R', 'R', '_', 'R', 'Y', 'R', 'Y' ],
    [ 'R', 'R', 'Y', 'Y', 'R', 'Y', 'R' ],
    [ 'Y', 'Y', 'R', 'R', 'Y', 'R', 'Y' ] ]

    Sorry about the formatting - doesn't render correctly in the comments here but if you copy it into a markdown reader it'll show the last game state.

  • Custom User Avatar

    Nit: the test cases pass in ints not strings. This precludes some very large numbers from being used as arguments (especially in JS which has a lower highest int)!

      test(0,5);
      test(4,5);
      test(10,2);
      test(20,3);
      test(60,5);
      test(219,11);
      test(729,9)
      test(1000,10);
      test(600001,100);