Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
  • I am going through the same thing, and I was wondering if tests keep the board from the previous tests with all of my lower case characters and underscores?
    I feel like the board should reset itself.
    Should this be fixed or should I amend my code? Thanks.

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

  • (C#) Fun fact: If one were to use IEnumerable (and yield return) instead of Stream (which is really just a poor way of emulating IEnumerable for languages which do not have it built-in), this kata becomes trivial .....

    (Now, you might say, "Well, if you change the task, of course it'll be easier", but that's not the point. The kata isn't designed to be arbitrarily difficult; it's intended to have to implement a useful design pattern. In some languages, the architecture of the Stream class is the best that can be done. But because that particular design is inappropriate for C#/.NET, it unnecessarally difficult.)

    (repeated with pseudo-spoilers in next comment)

  • Fixed for all three languages.

  • Hey, you're right, it's not optimal. I was only using the assumption that every test was called as new Boggle(...).Check(). (which turns out to be true even for random tests)

    If I wanted to refactor it, I'd put all the logic in other methods.

  • Looks like this is also in the Java and Python versions. The kata description says we will be provided with "strings up to 150 uppercase letters", so these languages are going against that.

    I'm too tired to fix it safely at the moment, but if nobody else has fixed this, then I'll get it resolved on the weekend.

  • In the C# random test (and maybe others), some of the "words" being tested contain underscores and lower case characters. This is not mentioned in the instructions (and, as I was using an underscore to replace used characters, it was driving me crazy)

  • An elegant solution, but I have one quibble. I wouldn't do the entire search in the ctor. Basically, it's poor usage of time. You hadn't been asked to find the word yet, and if no one calls Check(), you will never need to. So, why waste the time doing it before you have to?

  • You cannot have a flush and a pair. Your example has two deuces of diamonds. That would be an illegal desk.

  • This is an interesting technique, and would probably be best -- if there were new types of hands being created. However, since we've had the standard hands for over 100 years, that seems unlikely.

  • I don't see the point of the toDictionary step (but it will make it very less likely that the word will be in the same order when you read them back)

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

  • The order Distinct() returns items is not guaranteed.

  • if ((int)str[i] > 47 && (int)str[i] < 58)

    while this works, it rather difficult to read (and depends on ASCII encoding). Better to compare the chars as chars:

    if (str[i] >= '0' && str[i] <= '9')

    or even better, let the framework do the work:

    if (Char.IsDigit(str[i]))

    Also, C# knows how to add a char to a string:

    num = num + str[i];

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

  • Loading more items...