Ad
  • Custom User Avatar

    indeed, all SQL kata should specify an unambiguous ordering for the result table, otherwise the standard leaves it unspecified. I added an ordering criterion to this kata.

  • Custom User Avatar

    Really enjoyed this Kata. I know it's a very simple class, but as someone who is newer to coding it's not easy to find practice on class making. Gracias!!

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    It looks like you've solved this, and it's been awhile since you asked your question, so I'm sure you've figured this out by now... but a string of length 6 has 6 characters at indicies 0 through 5. If you try to check index 6, you're out of bounds.

  • Custom User Avatar

    At some point, it looks like nunit was updated or the tests were updated to use the modern Assert.That... pattern and is now correct.

  • Custom User Avatar

    Your code has a bug which acceses elements out of bounds of the input string and causes undefined behavior.

  • Custom User Avatar
  • Custom User Avatar

    .

  • Custom User Avatar

    Approved.

  • Custom User Avatar

    Fixed in this fork

  • Custom User Avatar

    Yes, the kata has a bug. The test code relies on the user solution to use using namespace std;, which is terrible.

  • Custom User Avatar

    is this broken? mine works fine on test but when i hit attempt it shows me this error? is it an internal bug? please fix it!

    In file included from main.cpp:7:
    ./tests.cpp:13:9: error: no template named 'vector'; did you mean 'std::vector'?
    vector empty;
    ^~~~~~
    std::vector
    /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_vector.h:386:11: note: 'std::vector' declared here
    class vector : protected _Vector_base<_Tp, _Alloc>
    ^
    In file included from main.cpp:7:
    ./tests.cpp:13:16: error: unknown type name 'string'; did you mean 'std::string'?
    vector empty;
    ^~~~~~
    std::string
    /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stringfwd.h:79:33: note: 'std::string' declared here
    typedef basic_string string;
    ^
    In file included from main.cpp:7:
    ./tests.cpp:37:9: error: unknown type name 'default_random_engine'; did you mean 'std::default_random_engine'?
    default_random_engine generator(chrono::system_clock::now().time_since_epoch().count());
    ^~~~~~~~~~~~~~~~~~~~~
    std::default_random_engine
    /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/random.h:1591:24: note: 'std::default_random_engine' declared here
    typedef minstd_rand0 default_random_engine;
    ^
    In file included from main.cpp:7:
    ./tests.cpp:37:41: error: use of undeclared identifier 'chrono'; did you mean 'std::chrono'?
    default_random_engine generator(chrono::system_clock::now().time_since_epoch().count());
    ^~~~~~
    std::chrono
    /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/chrono:971:13: note: 'std::chrono' declared here
    namespace chrono
    ^
    In file included from main.cpp:7:
    ./tests.cpp:38:9: error: unknown type name 'string'; did you mean 'std::string'?
    string alphabet = "abcdefghijklmnopqrstuvwxyz1234567890 ";
    ^~~~~~
    std::string
    /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stringfwd.h:79:33: note: 'std::string' declared here
    typedef basic_string string;
    ^
    In file included from main.cpp:7:
    ./tests.cpp:39:33: error: no template named 'uniform_int_distribution'; did you mean 'std::uniform_int_distribution'?
    auto randomChar = bind(uniform_int_distribution(0, alphabet.size()-2), generator);
    ^~~~~~~~~~~~~~~~~~~~~~~~
    std::uniform_int_distribution
    /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/uniform_int_dist.h:58:11: note: 'std::uniform_int_distribution' declared here
    class uniform_int_distribution
    ^
    In file included from main.cpp:7:
    ./tests.cpp:40:33: error: no template named 'uniform_int_distribution'; did you mean 'std::uniform_int_distribution'?
    auto randomCount = bind(uniform_int_distribution(0, 20), generator);
    ^~~~~~~~~~~~~~~~~~~~~~~~... and more

  • Custom User Avatar
  • Custom User Avatar

    done

  • Loading more items...