Ad
  • Custom User Avatar

    Description must contain a rule about a boards where any move will be fail.
    Wasted so many attempts to know that function must return any free point (not -1, null, false or undefined).

  • Custom User Avatar

    I must return index of the move right 0-8 || -1? Then why it shows some kind of error...

  • Default User Avatar

    Can someone explain how it works?

  • Custom User Avatar

    I also assumed we had to make the "best" move possible. The description isn't all that clear about what is required.

  • Custom User Avatar

    fun kata. I just don't understand why it is 6kyu and the other - simple result-checker kata - is 5 kyu. I think this kata looks a step further. It is fine for a 6kyu just I find the other one simpler. nvm

  • Custom User Avatar

    Hi!

    Written tests allows to push partial kata solution

    just look at my terrible solutions, wich passed the tests.

    suggest add this case:

    b = ['O', 'X', 'X', '', '', 'X', 'X', 'O', 'O'];
    Test.expect(solveTTT(b.slice()) == 4, "Error with board: " + b + " - Got: " + solveTTT(b.slice()));
    
  • Custom User Avatar

    Oh, right, it's already a winning board.

    I'e changed the random tests so it only generates non-winning boards.

  • Custom User Avatar

    There's a problem with the random tests. In almost all cases, there will be at least one test with no solution. A couple examples I've encountered below:

    // Example 1:
    ['X','O','O',
      '','X','O',
     'O','X','X']
     
    // Example 2:
    [ '','O','O',
     'O','O','O',
      '','O', '']
    
  • Custom User Avatar

    Oops, forgot to check reply type ;-)

  • Default User Avatar

    Voile (2 dan) - 50 minutes ago [ISSUE]
    Approved

    Just lol'd.

  • Custom User Avatar

    Approved

  • Custom User Avatar

    Fixed

  • Default User Avatar

    And other corner cases, i added an off by one and still passed all tests.

  • Default User Avatar

    @matt c: As the author has been inactive since November 2014 can you please add the random tests? Thanks, suic

  • Custom User Avatar

    Needs random tests and example tests but good kata :)

  • Loading more items...