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.
You are right...
Ok,make an item list which can be used.
Ok,sloved!
It should be
not more than
, because it's allowed for the two to be equal (and the tests expected this as well).What kind of coins are involved? It's not mentioned anywhere at all.
This kata is no different from https://www.codewars.com/kata/making-change except for the formatting.
I think it's ok now - haven't looked for details, but 4 random tests should be enough (perhaps next time it's better to use a loop for more tests and shorter code), so thanks for the work;-)
Thanks for the tip! I have added a few random tests, please let me know what you think, also I have changed some of the input validation stuff around from another user's critcism that it was a bit confusing.
@Kaiyou
I change the wording to be more clear, and took away the "Assume" part so it's clear you need to check for the input to be correct. Let me know what you think.
@ben8p:
I am also very very very very very very very very confused! I'm not sure the last example test case is pointing me to the correct solution, it seems to suggest that you would need to structure the calls the way I expect but not with 8 method calls with blank input, and then 3 method calls with non blank input.
Edit: your example shows up now, it was hidden before i commented!
Hi chuckmag, that's the usual way to implement these final testcases. For solved katas you can see code examples if you click/look at "Show Kata Test Cases" (open a solved kata and you will see this "link" in the middle of the site). There you will find what others do and surely there are some examples with random tests too - probably it's the easiest way to find out what to do exactly;-)!
Hi smile67, I get your point with this solution that some Random Test Cases would help make this Kata better. I was thinking about how to implement that and the best i could come up with is actually having the correct implementation in the Test Class so that I can run that Random Test inputs through the correct solution and compare it to the user's. Is that the best way you might implement random test cases?
That's fair criticism. I agree that your wording is less confusing and actually the suggestion to make it more like what a Vending Machine would do is even better. I'll consider adding that and updating the kata!
Thanks for your feedback.
I didn't really get from the description, that the user can input more money and that I have to protect against that. Maybe change
to
..also, wouldn't it be better to just return the users money? This way the machine eats the money, which isn't something a machine is supposed to do,...
Just took a look at your solution and I haven't tested it, but maybe your inputMoney > 1 should be inputMoney > 1m. I think if you were doing this in visual studio you'd probably get warnings about that.
Loading more items...