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.
I think for this kata to live up to "diabolical" it should require constant time solutions. Tests should include large very inputs, and expect very large outputs.
You need to specify the units for all relevant arguments. I am guessing that distance will be in
meters
and that velocity will be inmeters/second
, but people shouldn't need to assume that, it should be clear. (The time parameter is irrelevant, but the distance parameter is important, since you defined the width of the bird incm
)Are you sure your algorithm is correct? When I use 10cm affinity, I get way more bounces than you, but when I use 1km affinity, I'm at most 1 bounce away from you.
Please also explain the parameters in the description, even if they are explained in the other kata.
Seriously?
The description spins this grand tale about the fly flying back and forth between cars, so I spend time calculating and coding a solution for this, and then that part of the code is never tested. The fly is always 10x slower than any of the cars, it never completes a single trip, much less round-trip.
Either increase the fly's speed so this has to be taken into account or delete that from the description.
Sorry if I sound frustrated. I thought the problem posed a really cool idea. Turns out I could have stopped coding after the second line.
Don't round floats! Compute result with maximum precision and compare with
test_approx_equals
.https://docs.codewars.com/authoring/kata/floating-point/
https://www.codewars.com/kata/5f9f43328a6bff002fa29eb8
It would be worth to specify whether orders of magnitudes are expressed in multiplies of 1000 or 1024.
While it's clear that 1MiB = 1024KiB, having only KB, MB, etc. visible it's not clear if it means multiplier of 1000 or 1024.
One sample test makes no sense:
The expected result should be
"15 TB and 27 MB"
.(or the expected outcome in case of exactly
2 items
must be stated in the description, but it is bad style)P.S. It would be a good idea to add some examples and explanation in the description.
This is a terrible idea. You shouldn't rely on people to know arbitrary programming languages to solve the task.
In python the standard way to return multiple values is a tuple.
hi,
map
as argument name because it shadows the built-inAs pointed below, the main problem here is that we already have a lot of this kind of problems, so it's effectively a duplicate.
cheers!
There're already many pathfinding katas. Judging from the description, this one has nothing novel or interesting to offer.
The JS version expect Python:
/workspace/node/test.js:5
import codewars_test as test
Do not round floating point values.
Ask for a result value and test it with a margin for error.
This is extensively documented.