Ad
  • Custom User Avatar

    I learned quite a few ways for manipulating execution time from this kata and it's solutions, so I disagree with you here.

  • Custom User Avatar

    Given the variance in solutions I don't think it's that/completely pointless.

    People who don't know or recognize that a sleep can be used can learn about that. It's certainly different to a busy-wait.

    And the solutions are certainly varied, which can be interesting to look through - but is/should maybe not the goal of a kata.

  • Custom User Avatar
    1. try to search for a relationship between the starting points and height
    2. one can notice that we can get a rate of change between starting points and height which is how height changes with change in starting points
    3. once this rate of change is known we can unfold the relationship between the two by using a linear equation like y = mx +c for example if we take heights on x and starting points on y we can calculate for the intercept or c which would give us an equation telling what starting point is w.r.t given height.
    4. then simply put the give height into the equation to get the answer(starting point)
  • Custom User Avatar

    The form "dice" is plural. The singular form is "die." So you don't roll a dice, you roll a die. (Admittedly, even a lot of native English speakers don't know this!)

  • Custom User Avatar

    The description needs to be reworded. Angles can not be perpendicular or parallel to each other, this is not how geometry works. Angle planes can be perpendicular or parallel to each other, but that's a whole different problem in three dimensions.

    I suppose you mean something along the lines of "Angles a and b combined form a right angle".

  • Custom User Avatar

    im pretty sure that you cant really determine if the lines are perpindicular or parallel by only knowing the angles. (i might be wrong)

    the description seems to have incorrect info as it states 2 PI radians is equal to 180 degrees which is incorrect. 2 PI radians is 360 degrees. The test cases might accidentally follow this incorrect rule which might result in improper test cases

  • Custom User Avatar

    Random tests are incorrect:

    check_angle('3.5 pi', 0)
    'perpendicular' should equal None
    
  • Default User Avatar

    I agree with dfhwze's comments below.

    Here are my suggestions:

    • In your Description, you need to define what it means for two "angles" to be perpendicular or parallel. I mistakenly assumed that you wanted us to anchor one of the lines (or rays) from each of the angles with the vertex at the origin (x=0, y=0) and along the x-axis. I then assumed that you wanted us to determine whether the angle formed by the second lines (or rays) were either parallel or perpendicular with each other. Based on the kata results however, a difference of 270 degrees is not considered to be "perpendicular angle".
    • In the "Task" section of your Description you state: "You must determine whether the two angles or parallel or perpendicular". The first "or" should be "are"
    • In the "Good to Know" section of your Description you state: "180 degrees = 2pi". This should be changed to either "360 degrees = 2pi" or "180 degrees = pi".
  • Custom User Avatar

    I "solved" this kata in its current state, but the description should clarify what is a parallel angle and what is a perpendicular angle (or at least link to a website that gives these definitions). I basically relied on my knowledge of parallel lines and perpendicular lines and hoped this knowledge would apply to angles, too.

    Also: The description says that one of the angles will be specified in radians, but it's not really specified in radians, but in terms of pi. So in effect you have to convert from that to radians, then from radians to degrees.

    By looking at the results of the random tests, I was able to identify specific situations in which the kata expected None to be returned, but I have no idea why!

  • Custom User Avatar

    Brilliant, really liked this one, made me learn a new math formula!)

  • Custom User Avatar
  • Custom User Avatar

    Ok, I added "from solution import pick_em_up". I did not realize that is how it worked. Yes, I didn't like the nested if either. I did know the percents were not perfect and thought about doing the math for it but as you said, they are rather arbitrary and I needed some random statements that worked.

    Thanks again for all your help.

  • Default User Avatar

    Ah, sorry, I was describing that in a weird way -

    codewars adds from solution import * if you don't import the solution yourself, which should be from solution import pick_em_up

    I DON'T like how you wrote those probabilities because.. the chances there are:

    0.01 * 0.99**0
    0.01 * 0.99**1
    0.01 * 0.99**2
    0.01 * 0.99**3
    

    on the other hand it's simple so I can't really argue with it. the numbers are arbitrary anyway. the nested if-statements is what really bothered me. I don't need to like it. that's fine.

  • Custom User Avatar

    I'm sorry, I don't see where import * is.

    I added your fresh package, thank you for that.

    I also updated the random code to do and explain the percentanges better.

    Am I on the right track?

  • Default User Avatar

    you should not import * because the solver may define things with names that you then end up using but thinking it's something else. only import the solution itself so that you're in control of your namespace :x

  • Loading more items...