Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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 ??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!
No random tests?
C++ should use
std::string
and not C-strings: https://docs.codewars.com/languages/cpp/authoring/This kata is a duplicate: https://www.codewars.com/kata/5168bb5dfe9a00b126000018
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.nullptr
is not an empty array; the latter would be a zero-sized object which has different behaviour from a reference tonullptr
, and in almost all other languages empty array is definitely notnull
.Also I'd argue that zero faces is a valid input. Why can't I have an empty model?
Design question: Is there any reason to modify
unsigned int *count
and returnVertex*
inside a function when it's equivalent tostd::vector<Vertex>
, and test fixture usesstd::vector<Vertex>
as expected value? Since this is a C++ kata and not a C katastd::vector<Vertex>
would be the natural choice except for very specific reasons, which I don't see any.Vertex
is a custom class so its definition should be given in the description. (We can't see Preloaded code)Expected: true, Actual: false
is not acceptable test feedback (it doesn't tell you why it's wrong).