Include the static tests in the full test suite, not just the sample test suite - your code does not guarantee that empty strings will be tested and so invalid solutions could slip through by trying to run the tests enough times
It might improve the user experience to have the static tests each as a separate [Test] method - that way it is a bit clearer which test is failing
Add a fixed test with null as the argument - also consider including null in your array of names in the random tests
Rename test method from MyTest, e.g. RandomTests
Whilst not absolutely necessary, remove the (now redundant) TODO comments knocking around
Calling [...].Substring(...).ToString() is a redundant call to [...].ToString() - Subtring(...)returns a string.
The reference solution isn't ideal - try/catch shouldn't normally be used for flow control, what errors are you expecting to catch here? Rather than lazily use try/catch for edge cases, think what they could be and explicitly guard against them / use flow control to deal with them
Thanks. I was dumb to not notice that... So now I'm passing the sample tests, but failing some random ones. Could be related to @FArekussu issue raised above, IDK.
OK, will do!
A few suggestions:
C# Translation
https://www.codewars.com/kumite/606e0253a1a60d00251c7342
Thanks. I was dumb to not notice that... So now I'm passing the sample tests, but failing some random ones. Could be related to @FArekussu issue raised above, IDK.
It's "least significant bits".
Either the reference solution is wrong, or some information is missing from the description.
Edit: I've looked at your solution, and it is indeed incorrect.
Since it's BGR555, you need to put the blue (00100) first and then green then red.
Could you please explain then:
Where am I going wrong?
i have to make another post to make it resolved because i forgot
Fixed.
Fixed!
each pair
Should each hex character be converted to 4-digit binary representation, or should it be the whole hex pair, padded left to 8 digits?
OK, I can.
You will need to add extra zeroes to the beginning so that the number reaches 8 digits.
Loading more items...