Ad
  • Custom User Avatar

    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.

  • Custom User Avatar
  • Custom User Avatar

    In JS, it's absolutely idiomatic to if ( or similar ) on things that are not actually Booleans, but have truthy or falsy values.

    Best you could do in JS is name the argument boolsy; bool is 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. )

  • Custom User Avatar

    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 either true or false. Calling null or undefined or "" as bool is kinda strange, but maybe that's what JS does? :D

  • Custom User Avatar

    Descriptions 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" by true.

  • Custom User Avatar

    The description is a bit weird on the Rust version of the problem and it says "When bool is truthy".

  • Custom User Avatar

    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.

  • Custom User Avatar

    Nice problem for helping me learn Java. The story was entertaining

  • Custom User Avatar
  • Custom User Avatar

    I have never heard of toddy before

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    Thank you bro this helped a lot.

  • Custom User Avatar

    I am curious, what is the meaning of lambda?

  • Loading more items...