Ad
  • Custom User Avatar

    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?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    Thanks! I've been enjoying watching you, B4B and blinker play with it in the fork. I learned some stuff.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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)

  • Custom User Avatar

    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.

  • Custom User Avatar

    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?

  • Custom User Avatar

    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.

  • Custom User Avatar

    Hard to say without seeing your code. Perhaps a non-alpha character, followed by a capital?

  • Custom User Avatar

    Ken, that is in your description...

    "from a list of integers."
    
  • Custom User Avatar

    Python translation added.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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...