Ad
  • Default User Avatar

    Ruby: Expected: "13.333333333333334 is above freezing temperature", instead got: "13.333333333333332 is above freezing temperature"

    I know it's a different language but did you ever solve this issue? I feel kind of cheated by the unrealistic expectation of the kata expecting so many decimal places.

    Is it maybe my maths that's the issue?
    (temperature - 32) / 1.8

  • Default User Avatar

    I know this is two years old but you may be hitting an infinite loop on the last test (0).

  • Default User Avatar

    Thank you and sorry, writing XOR from scratch because I'm too new to coding to realise that all 3 had a shortcut (as per other people's solutions), but hey that's how we learn! :)

  • Default User Avatar

    Random test (in Ruby)
    Testing for [true, true, true] and "XOR"
    It should work for random inputs too - Expected: true, instead got: false

    I believe this is wrong and should be returning false (this has taken me longer than some 6KYU's to try and work out, so if I'm mistaken a) I apologise and b) oh no! :(
    I had to repeat the random tests to find it as I was passing most of the time, it's just from refactoring I found this out.

  • Default User Avatar

    apologies, I don't know how the infastructure of codewars works so didn't know it could be taken down.

    I still don't think it's clear that the kata wants us to make it into array, take away the first and last elements and then do it with whitespace instead of commas. I know you're agreeing with the last part of the statement but the first two parts of the process are really unclear.

    Hopefully if other people have the same issue they'll see this comment at least and that might help them understand.

  • Default User Avatar

    Until this kata has a proper description it should be taken down.
    I had to write notes based on digging through the discourse to understand what it wanted:

    #I've tried to avoid naming methods here so as to not give the game away.
    #break string up into an array using the commas as the break points.
    #remove the first and last element from the array
    #if the array is only 2 elements long return nil, otherwise return the new array, where the commas were you should now have spaces.

    This 8KYU will only bring frustration due to ambiguity to new coders, and putting new coders off of coding is not a good idea.

  • Default User Avatar

    I could be wrong but I think it is the US, not the Europeans, that ommit the 13th floor. I believe in Europe we do usually have 13th floors (I've never noticed one missing at least).
    Note: I haven't been to the US, hence could be wrong!

  • Default User Avatar

    Not only would I also like to at least have a link so I know what the system is, I don't know why you are acting in such a hostile manner. Please reconsider how you communicate with others.

  • Default User Avatar

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

  • Default User Avatar

    Your maths equation is wrong. You want to calculate what the draft is if there are no crew on board.
    Each crew member = 1.5 of the draft, and you have the draft including the crew.

    If I say anything more I'll have to put it in a spoiler.

  • Default User Avatar

    My mistake, solved it now!
    Would delete this if I could work out how, is that possible?

  • Default User Avatar

    when I clicked test the basic tests worked, when I clicked attempt they did not.

    I have re-made my code using new Ruby I have learnt since attempting at I was at fault!

  • Default User Avatar

    Can't remember if I mentioned it here, but to just to be clear, language is Ruby. Can't access my own comment as it has a spoiler, so it's now hidden...

  • Default User Avatar

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

  • Default User Avatar

    Language: Ruby
    After my code hasn't been working, I tried to just output the str and letter to gather what is going wrong, as the test itself seems to be broken.

    My code in the method:

    ary = []
    p str
    p letter
    

    This was the output for the random tests (first stage basic tests work fine).

    (Test::Error)
    from /runner/frameworks/ruby/cw-2.rb:46:in measure' from /runner/frameworks/ruby/cw-2.rb:51:in describe'
    from /runner/frameworks/ruby/cw-2.rb:202:in describe' from main.rb:14:in '

    Please can someone have a look at the tests and let me know if my code really is broken, or if the tests are all messed up?

    I'll leave a seperate comment with the code I was trying, but in case others are having issues, I wanted to make sure they see they're not the only ones :)

  • Loading more items...