This comment is hidden because it contains spoiler information about the solution
Completed this kata just to say that "It is possible to mutate the input to the function. This is something that you should never do" is a terrible way of saying "do not mutate function input even if your language permits you to do so" (or something like that).
I love how many different solutions are there for this kata.
Nice kata, love it. Wanted to learn how void pointers work in C for a long time, but never had the time needed to come up with some good use case. This Kata did it for me. Thanks!
What? How does this even...
Ok, after looking at what everyone else did, I do feel kinda stupid.
It still amazes me how much more simple and clean code can you start writing, once you trully "get" functional programming
I'm glad you enjoyed it!
Thanks, good idea. I'll update the test next week.
Because I want to let the user know that the parameter is the floor, the other reason is to keep consistent with the simple version.
Turn floor into f to consume up to 1 calories.
So, don't be too lazy. that will make you more fat ;-)
On submit in assertEquals you have swapped "expected" and "actual" values. It says "Expected: %user input%, should be: %something you expect%" but it should be other way around