Beta

Fiber Optic Network

Description
Loading description...
Algorithms
Lists
Graph Theory
  • Please sign in or sign up to leave a comment.
  • eurydice5717 Avatar

    Trying this kata... IMHO VERY strange to return a C++ nice structure; and to pass a C-like [] etc... a vector<tuple <x,y,z>> would be great :-)

  • Voile Avatar

    Missing random tests ;-)

  • Voile Avatar

    Sample tests relies on the existence of using namespace std; in user code to work.

  • FArekkusu Avatar

    The image in the description is dead.

  • siebenschlaefer Avatar

    Nice kata with a classic problem.

    You might want to consider using the full power of the test frameword (i.e. Igloo / Snowhouse). Put this into the "Preloaded" section:

    #include <list>
    
    namespace snowhouse
    {
        template<>
        struct Stringizer<std::list<std::pair<int,int>>>
        {
            static std::string ToString(const std::list<std::pair<int,int>>& a)
            {
                if (a.empty()) return "{}";
                std::ostringstream stream;
                stream << "{(" << a.front().first << ", " << a.front().second << ')';
                for (auto it = std::next(a.begin()); it != a.end(); ++it)
                    stream << ", (" << it->first << ", " << it->second << ')';
                stream << '}';
                return stream.str();
            }
        };
    }
    

    and change Assert::That(expected == actual); to Assert::That(actual, Equals(expected)); to get more helpful output for failed tests.

    • drexduarte Avatar

      Hi siebenschlaefer, thank you for you suggestion!

      It was really appreciated!

      I saw you edited the kata, is it necessary any approval?

      Suggestion marked resolved by drexduarte 7 years ago
    • siebenschlaefer Avatar

      No approval needed. (You checked "Allow Contributors" and since my edit did not change the kata's essence I felt safe to apply it.) Thanks for this nice kata.