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.
Fork here.
I am not exactly sure what kata you mean exactly, but I remember some kata about Mancala\Sungka\Kalah\Bantumi: Sungka, Pot-tentially the Greatest Mancala Kata. As far as I know, all of them are distinct games, all coming from the common family of Mancala games.
Having said that, I do not know how existing kata, and the games themselves, are close to each other, and whether they are close enough to be considered dupes/repetitive. It's possible, I just haven;t solved the kata.
It is because by use of
float
and real division operator/
, you introduce small inaccuracies into your solution, which sometimes, in certain circumstances, for some inputs, can trick your solution into doing some incorrect approximation, or unintended rounding, because this is how floats work. When you change line 6 of your solution to something liketime_decimal_secs = g * 60 * 60 // relative_speed
, you have no floats anymore, no inaccuracies, and (if I see correctly) solution with this change will always pass.You can check what exactly happens by recreating one of failing inputs in your IDE and running it with a step-through debugger, observing intermediate variables. You will notice how in some point, some rounding happens, which slightly changes the outcome and leads to an incorrect answer.
"0 0 0"
ten times is not necessary. Once should be enough.https://www.codewars.com/kata/reviews/68526d48404799a753fa23c9/groups/68528d3184ac1bcf1e0dd799
It's not about tests which are "rounded up". It's about your code which is a bit buggy, and sometimes performs incorrect rounding.
If copilot ever generated me code which contains
96
, I would disable it immediately :DSuggestions:
add
toint Function(int) add(int n){ ... }
and solution setup to something like:I think that this looks much nicer in strongly typed languages. If someone will solve it with
dynamic
then fine, but static types are so much neater :)add(x)
. Users who do not know how to do "functions in functions" will attempt to return strange things fromadd
, and tests will crash attempting to call an uncallable thing, resulting in confusing failure messages. You can try something likeexpect(add(x), isA<int Function(int)>(), reason: "\nadd(x) should return a function");
, maybe extracted to a helper function like following pseudocode:(make sure to use
reason:
for clear failure messages).Updates tests to Node 18.
Updates tests to Node 18.
Updates tests to Node 18.
Updates tests to Node 18.
Updates tests to Node 18.
I was thinking about using 3-tuple for the return type, which is always a value with three integers. What do you think?
Loading more items...