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.
C++
What is the meaning of this test failure:
Expected: equal to "Error caught"
Actual: "Error not caught"
Thank you so much.
What do you mean by "Of course, you don't really need to do this just to solve the kata."? Can I also debug with the CodeWars editor environment?
Ok, I had thought my Visual Studio was not configured. For example, that I haven't updated igloo properly. But that's probably not the case.
But there is still one problem. If I use the definition of the class Image given in the text, then it does not compile.
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(129,18): error C2440: 'initializing': cannot convert from 'initializer list' to 'CentralPixels::Image'
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(136,1): message : No constructor could take the source type, or constructor overload resolution was ambiguous
On the website, however, a definition is apparently used that works. Can I have that too?
I use C++, Visual Studio 2022, Language Version is C++ 17.
When I copy the SampleTests of this Kata into Visual Studio 2022, the compile complains about undefined symbol Unordered_Match:
1>CentralPixels.cpp
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(101,54): error C3861: 'Unordered_Match': identifier not found
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(101,1): error C2664: 'void snowhouse::ConfigurableAssertsnowhouse::DefaultFailureHandler::That(bool)': cannot convert argument 1 from 'std::vector<unsigned int,std::allocator>' to 'bool'
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(101,40): message : No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>A:\develop\Training\CodeWars.cpp\import\igloo\external\snowhouse\snowhouse\assert.h(109,19): message : see declaration of 'snowhouse::ConfigurableAssertsnowhouse::DefaultFailureHandler::That'
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(105,54): error C3861: 'Unordered_Match': identifier not found
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(105,1): error C2664: 'void snowhouse::ConfigurableAssertsnowhouse::DefaultFailureHandler::That(bool)': cannot convert argument 1 from 'std::vector<unsigned int,std::allocator>' to 'bool'
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(105,40): message : No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>A:\develop\Training\CodeWars.cpp\import\igloo\external\snowhouse\snowhouse\assert.h(109,19): message : see declaration of 'snowhouse::ConfigurableAssertsnowhouse::DefaultFailureHandler::That'
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(109,54): error C3861: 'Unordered_Match': identifier not found
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(109,1): error C2664: 'void snowhouse::ConfigurableAssertsnowhouse::DefaultFailureHandler::That(bool)': cannot convert argument 1 from 'std::vector<unsigned int,std::allocator>' to 'bool'
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(109,40): message : No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>A:\develop\Training\CodeWars.cpp\import\igloo\external\snowhouse\snowhouse\assert.h(109,19): message : see declaration of 'snowhouse::ConfigurableAssertsnowhouse::DefaultFailureHandler::That'
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(113,54): error C3861: 'Unordered_Match': identifier not found
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(113,1): error C2664: 'void snowhouse::ConfigurableAssertsnowhouse::DefaultFailureHandler::That(bool)': cannot convert argument 1 from 'std::vector<unsigned int,std::allocator>' to 'bool'
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(113,40): message : No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>A:\develop\Training\CodeWars.cpp\import\igloo\external\snowhouse\snowhouse\assert.h(109,19): message : see declaration of 'snowhouse::ConfigurableAssertsnowhouse::DefaultFailureHandler::That'
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(117,54): error C3861: 'Unordered_Match': identifier not found
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(117,1): error C2664: 'void snowhouse::ConfigurableAssertsnowhouse::DefaultFailureHandler::That(bool)': cannot convert argument 1 from 'std::vector<unsigned int,std::allocator>' to 'bool'
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(117,40): message : No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>A:\develop\Training\CodeWars.cpp\import\igloo\external\snowhouse\snowhouse\assert.h(109,19): message : see declaration of 'snowhouse::ConfigurableAssertsnowhouse::DefaultFailureHandler::That'
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(122,54): error C3861: 'Unordered_Match': identifier not found
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(122,1): error C2664: 'void snowhouse::ConfigurableAssertsnowhouse::DefaultFailureHandler::That(bool)': cannot convert argument 1 from 'std::vector<unsigned int,std::allocator>' to 'bool'
1>A:\develop\Training\CodeWars.cpp\CodeWars\CentralPixels.cpp(122,40): message : No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>A:\develop\Training\CodeWars.cpp\import\igloo\external\snowhouse\snowhouse\assert.h(109,19): message : see declaration of 'snowhouse::ConfigurableAssertsnowhouse::DefaultFailureHandler::That'
1>Done building project "CodeWars.vcxproj" -- FAILED.
Assert::That( image.central_pixels(1), Fulfills(Unordered_Match(red_ctr)) );
Inside the tests of this kata.
What is Unordered_Match?
the variable sign in function determinant is not used. I forgot to remove it.