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.
It’s not subtracting anything. // is floor division. The division by 0.036 converts km/h to cm/s, and the floor just drops the decimal because the result must be an integer.
In JS, it's absolutely idiomatic to
if( or similar ) on things that are not actuallyBooleans, but have truthy or falsy values.Best you could do in JS is name the argument
boolsy;boolis overselling it.Unless we want to fork the description into multiple versions for this quite minor point, Rust ( and Haskell, and probably more strongly typed languages ) people should just live with it. There are countless other kata where solvers have to read descriptions that were not specifically written for obscure languages.
( Yes, I just called Rust obscure. On CW, anything that's not JS or Python has nowhere near the amount of solves those two have. )
But to be honest, this is strange also in JS. If the argument is named
bool, then it is expected to be, well, a boolean value. And as such, it's eithertrueorfalse. Callingnullorundefinedor""asboolis kinda strange, but maybe that's what JS does? :DDescriptions are shared between languages and this task was originally created for JavaScript. Since in Rust the function is typed with
cond: bool, you can expect it to be an actual boolean. I would not add language-specific blocks just to replace "truthy" bytrue.The description is a bit weird on the Rust version of the problem and it says "When bool is truthy".
This Kata needs a way better instructions and I am kinda confused about what is happening with negative numbers.
Also the "The order doesn't matter" thing should be more clear in the instructions.
Nice problem for helping me learn Java. The story was entertaining
https://www.codewars.com/kata/56170e844da7c6f647000063/discuss#5e617111f920eb001af56ddb
I have never heard of toddy before
I think it would be helpful to be able to see the hard codded test cases. Also on the random ones it is easy to keep trying until you get all of them.
It's because anonymous functions like that are very much inspired by the lambda calculus where you'd write λx. f x for python's lambda x: f(x) and it's just a "pythonization" of that syntax.
This was too hard for an 8 KYU, I would prefer it to be 7. Also it seemed like there was a few errors in the spelling and grammer of the discription.
Thank you bro this helped a lot.
I am curious, what is the meaning of lambda?
Loading more items...