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.
fixed that too
I have the exact same question. My code passes all other tests execpt this one.
Fixed first one. Second suggestion is changed to:
Not sure about my suggestion below, but yours doesn't fit the meaning:
:-)
I'll rework the description later today when I've got some time. Back to draft for now.
I could be misunderstanding the description.
For
[{"initial":[10,3,1,3,2],"steps":1,"stan":3,"ollie":1}
, I'm getting[ 9, 3, 3, 3, 3 ]
, but the answer should be[ 9, 3, 2, 3, 3 ]
according to your tests. I'm unsure how the value at index2
is2
when Ollie and Stan's value never change and they're the neighbours (4. If both neighbors have the same cadence, the soldier adopts that cadence.)Thanks. Well, that last statement should just be removed. I added it for clarity, but it is a false statement. Also added your test case in sample tests.
In your "Details" section you state:
If neighbors have different cadences:
a. The soldier's cadence moves one step towards the average (rounded down) of the neighbors.
b. If the rounded-down average is the soldier's current cadence, they move one step towards the fastest neighbor's cadence.
In both cases, if the soldier is already marching at the rounded-down average, they'll remain marching at that cadence.
As currently worded, the last statement in the above description is confusing. If for example, the "initial" array is [4, 4, 5, 6, 6] with "stan" at index 0 and "ollie" at index 4, what should the new value be at index 2? The average of its neighbors is 5. Statement "b" above states that the soldier's current cadence should move one step towards the fastest neighbor's cadence. Based on this statement, the new value at index 2 should be 6. The last statement however states that if the soldier is already marching at the rounded-down average, they'll remain marching at that cadence which would make the new value at index 2 to be 5.
Other than this description problem, this was another nice kata!! I really enjoy solving all of your katas.
Thank you. Here's another nice one, for the guitar: https://www.codewars.com/kata/63ac8b9e3f04b10022696fc3
Thanks for the quick fix. That was the only issue that I found. Great Kata!!
It was in the first fixed test, I changed it to be compliant to the specs. Any other cases where you see a test that does not adhere to the specs?
Well spot! Is this in a fixed or random test? In random tests, I should prevent to generate such cases. If it's in a fixed test, I'll update that test.
Let me begin by stating that this kata is awesome!!! With that said, I believe that I either identified a problem with one of your tests OR I don't completely understand the instructions for the "Glide Effect".
In your kata's description for the "Glide Effect" you state: "This effect will only be used if there is a next note entry, and if that note entry has a different pitch class as the current note entry.". In one of your tests however (see details below), two consecutive note entries are: 14A2g and 16A4gs. You are expecting the results for the "A" pitch class to be "A . . . . . . . . . . . . . . ● ↘ ● . . ~ . . . . . . . . . . . . .". This expected result shows a downward glide between two consecutive note entries for the same "A" pitch class. Since the pitch classes are identical for these two note entries, my solution doesn't display a downward glide but displays an "x" instead. Note I copied the output from that one failed test below.
Compact:
"A;0C.4bsg;4D2;6C.2g;8D4sg;12C.2b;14A2g;16A4gs;20B.2g;22C2g;24E.4sg;28D.b;29D;30C2"
Expected:
A' . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
G . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
F . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E . . . . . . . . . . . . . . . . . . . . . . . ↗ ○ . . ~ v . . . .
D v . . ↗ ● x . ↗ ● . . ~ v . . . . . . . . . . . . . . ↘ ○ ● . . .
C ○ . . ~ . . ○ x . . . ↘ ○ x . . . . . . . ↗ ● x . . . . . . ● x .
B . . . . . . . . . . . . . . . . . . . ↗ ○ x . . . . . . . . . . .
A . . . . . . . . . . . . . . ● ↘ ● . . ~ . . . . . . . . . . . . .
| . . . | . . . | . . . | . . . | . . . | . . . | . . . | . . . |
Actual:
A' . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
G . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
F . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E . . . . . . . . . . . . . . . . . . . . . . . ↗ ○ . . ~ v . . . .
D v . . ↗ ● x . ↗ ● . . ~ v . . . . . . . . . . . . . . ↘ ○ ● . . .
C ○ . . ~ . . ○ x . . . ↘ ○ x . . . . . . . ↗ ● x . . . . . . ● x .
B . . . . . . . . . . . . . . . . . . . ↗ ○ x . . . . . . . . . . .
A . . . . . . . . . . . . . . ● x ● . . ~ . . . . . . . . . . . . .
| . . . | . . . | . . . | . . . | . . . | . . . | . . . | . . . |
Loading more items...