Ad
  • Custom User Avatar
  • Custom User Avatar

    One comment said that only the last digit is allowed to be an X.. meh

  • Custom User Avatar

    Have to change the prototype in C++!!
    Common best practice is to always work with contiguous structures as arrays or vectors when dealing with INDEXES or VERTICES in graphics.

    You are using #include<vector> and.. returning a pointer to an array ?? REALLY ??

  • Custom User Avatar

    this is not a function technically

  • Custom User Avatar

    I really like the task, but the implementation ignores a lot of C++ authoring guidelines (and iiuc, pretty much on purpose), that's why I afraid it is quite unlikely it ever gets approved, and that is a shame.

    I would suggest re-making this kata with the guideline in mind.

    If you have any problems with that, feel free to ask in #help-author about anything you like.

    Cheers!

  • Custom User Avatar

    @Masterride05

    rather than stick too much to vectors

    This is a part of the standard library and in most cases a preferred way to pass dynamically sized arrays around. Also it is the preferred way on CW

    It's just an added challenge to allocate an array and stuff.

    It doesn't add a challenge in any meaningful maner, all it adds is unnecessary inconvenience.

  • Custom User Avatar

    C++ should use std::string and not C-strings: https://docs.codewars.com/languages/cpp/authoring/

  • Custom User Avatar
  • Custom User Avatar

    Raw pointers in C++. Yuck!

  • Custom User Avatar

    I'll fix it right now*

  • Custom User Avatar

    Alright! I'll add more information about what is missing / not good!

  • Custom User Avatar

    Alright thanks for the feedback, i'll fix it right now!
    The nullptr is a mistake pretty much, but keep in mind that i aim to keep this kata for C++ only, or maybe C but not in js for now.. Because of allocating an array and everything. It would be "unfair" towards say C++, since my idea was to NOT return a vector but allocate memory yourself.

    Well yeah true, about an empty model, but at that point you would allocate an empty array.. might as well parse in a nullptr, you know

  • Custom User Avatar

    Hello, my idea was to just make a function which returns an allocated array of vertices and sets the amount somewhere else. Of course a vector would do the same stuff, but i think it is a good training to do it ourselves rather than stick too much to vectors.
    Not that they're bad though, i used them myself in my solution. It's just an added challenge to allocate an array and stuff.

    By the way, the idea came from a personal project of mine. Which is why i use a pointer instead of a vector.

  • Custom User Avatar

    0 < i < inf

    Should be 0 <= i. Also < inf is undesirable here: language lawyers will argue with you how integers aren't arbitrarily sized. It should be removed.

    you will return an empty array (nullptr)

    nullptr is not an empty array; the latter would be a zero-sized object which has different behaviour from a reference to nullptr, and in almost all other languages empty array is definitely not null.

    Also I'd argue that zero faces is a valid input. Why can't I have an empty model?

  • Custom User Avatar

    Design question: Is there any reason to modify unsigned int *count and return Vertex* inside a function when it's equivalent to std::vector<Vertex>, and test fixture uses std::vector<Vertex> as expected value? Since this is a C++ kata and not a C kata std::vector<Vertex> would be the natural choice except for very specific reasons, which I don't see any.

  • Loading more items...