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.
Example 3 implies start_board and end_board might have different pieces, but out of all the test cases that's the only one where that's true. Maybe add some tests where there are different numbers of knights at the start and end?
This comment is hidden because it contains spoiler information about the solution
I think CodeWars must have changed since this kata was published, because it's currently impossible (the accepted solutions no longer work either).
I'd suggest that the tests should actually check the cwd for files, and get the necessary text, rather than have the tests hard coded.
Thanks! I've been enjoying watching you, B4B and blinker play with it in the fork. I learned some stuff.
Interesting notes, thanks for optimizing the solution. Looks like your tweaks were effective, according to B4B's fork.
Especially interesting about the list of [1] being faster, I didn't know that. Where can I read about that? I can't seem to find anything on Google.
That looks correct. Player 2 wins when Player 1 misses the ball (and on that turn, Player 1's miss is not announced).
The max score in that game (assuming that's the full game) is 5.
Typo in the kata description. Output requirements say:
'"Game over!" - If the game has ended but either player still hits the ball'
but the tests only accept "Game Over!" (capital O)
Thanks for your thorough proof-reading, Voile.
In order to avoid confusing people new to R who might not know the difference, I changed the Output requirements to specify "sample", but didn't change the first summary sentence. R's base functions assume the corrected sample SD, and the language in the docs generally doesn't differentiate.
Ah, my mistake, I didn't search beta katas. This is my first attempt at creating a kata, so I'm not sure: should I unpublish this one?
Thanks for the input. You're right, I was definitely too vague. I've made some edits to the description, hopefully it's clear enough now.
Hard to say without seeing your code. Perhaps a non-alpha character, followed by a capital?
Ken, that is in your description...
Python translation added.
There are many ways to achieve a matrix with all sorted rows and all sorted columns, for most sets of data. (See my solution for one other possible algorithm.)
The test cases should check if each row and each column are sorted, rather than check to see that it's equal to your algorithm's result.
I agree with Unnamed. Treated as a physics problem (as it's stated), this kata is unsolvable.
Using your example, the Capulet has a pull force of 3.5 kg*m/s^2 (a.k.a. N(ewtons)), and the Montegue has a pull force of 3.2 N. That's a sum force vector of 0.3 N in the Capulet's direction.
To calculate their acceleration, you need their masses. If together they weigh 100 kg, (assuming no friction) their acceleration will be 0.003 m/s^2. If together they weigh 200 kg, their acceleration will be 0.0015 m/s^2.
The other issue with the kata is that you're treating acceleration as equivalent to velocity. (Assuming that together they weigh 1 kg, as you do in your example,) after 8 seconds they will not have travelled 2.4 m, they will be travelling at 2.4 m/s. The distance travelled will be 1.2 m (because they started with 0 velocity). As the next pair of participants hop in, acceleration momentarily goes to 0, but velocity remains. The rope will continue travelling toward the Capulets, until the stronger Montegue has time to turn the tables.
You can see this yourself, by doing the algebra on the units:
(kg*m/s^2) / kg = m/s^2 (force divided by mass equals acceleration)
(m/s^2) * s = m/s (acceleration multiplied by time equals velocity)
Loading more items...