Ad
  • Custom User Avatar

    Certainly not a "Best Practice"

  • Default User Avatar

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

  • Custom User Avatar

    Thanks for the feedback....description updated!

  • Default User Avatar

    This line:

    earns one point and takes another turn

    could easily change to:

    earns one point and takes another turn only if another box can be made.

  • Custom User Avatar

    In C# the table is called Preloaded.MORSE_CODE for some reason.
    I've just noted that in the kata description.
    Thanks!

  • Default User Avatar

    Attempting this Kata with C# I am unable to see how I can use the built in Mapping/Dictionary, which previously worked as MorseCode.Get(""), and now seems like it may have a different name, but none of my attempts to use it with any name have worked. I can't compare the second part of this kata since it is not in C#. Will I need to create my own mapping?

    Instructions indicate: The Morse code table is preloaded for you as MORSE_CODE dictionary, feel free to use it. (For C, the function 'morse_code' acts like the dictionary. For C++ a map is used.)

  • Default User Avatar

    But the function does not only limit the values!

  • Custom User Avatar

    Sorry to hear that. I wrote the kata this way because it would have been very dificult checking for the next line as it could be any of the available lines. :-)

  • Default User Avatar

    Ok, that makes sense, but I beleive the Kata could be improved by including those specific requirements in the instructs. As they are, the instructions leave this very open ended. Nowhere does it indicate that you are only to create lines IF they create a box, one would assume they are creating an AI to play against, and the AI would be useless if could not take a turn in a case in which it could not score...

    Thanks for the good Kata, however, I just was frustrated I couldn't get a working solution after expending a good deal of effort on it!

  • Custom User Avatar

    The BasicTest1 game is explained in the kata description :-). If you were to add the line 7 then it wouldn't be a box.

    In a 2x2 game the lines are numbered as below

    You don't score another turn after 1,3,4,6 becuase the aim of the kata is to work out how many full boxes you can create. You are only allow to add lines if you are able to complete the square.

    So for 1,2,3,4,5,8,10,11,12 you would follow these steps

    [] would result in [] because you do not have any lines to even attempt to finish a box :-)

  • Default User Avatar

    HELP! I'm missing something!
    BasicTest1 test: "{ 1, 3, 4 }" expects a solution of "{ 1, 3, 4, 6 }"
    Why is the solution not "{ 1, 3, 4, 6, 7}" since the instructions say, "The player who completes the fourth side of a 1×1 box earns one point and takes another turn."
    and the BasicTest3 test: "{ 1, 2, 3, 4, 5, 8, 10, 11, 12 }" requires that behavior to achieve: { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }

    Why do you not score another turn when completing the Box: {1, 3, 4, 6}?
    This same logic applies to BasicTest2: { 7, 9, 12 }

    ALSO: why does it not play a line in the tests, when you pass in an empty game: new List { }
    I would assume this means it is the first turn and the computer is going first, therefore, it would return a single line result since it played a line!

  • Default User Avatar

    I used the SUM method wondering if the tests would be vague enough to fall of it. It did... this test could easily be added to catch my sneaky solution.

            var test = new int[][]
            {
              new int[] {5, 5, 5, 5, 5, 5, 5, 5, 5}, 
              new int[] {5, 5, 5, 5, 5, 5, 5, 5, 5},
              new int[] {5, 5, 5, 5, 5, 5, 5, 5, 5},
              new int[] {5, 5, 5, 5, 5, 5, 5, 5, 5},
              new int[] {5, 5, 5, 5, 5, 5, 5, 5, 5},
              new int[] {5, 5, 5, 5, 5, 5, 5, 5, 5},
              new int[] {5, 5, 5, 5, 5, 5, 5, 5, 5},
              new int[] {5, 5, 5, 5, 5, 5, 5, 5, 5},
              new int[] {5, 5, 5, 5, 5, 5, 5, 5, 5},
            };
    
  • Default User Avatar

    Wtf, this isn't my solution... how did someone else's solution get put as mine... oh well.

  • Default User Avatar
  • Default User Avatar

    Makes me sad as well, shows what happens when I rush it in 5 minutes and don't refactor! Regardless, thank you for the kind comment...

    Shall I critique yours? Use an enum perhaps?

  • Loading more items...