Ad
  • Custom User Avatar

    python new test framework is required. updated in this fork

  • Default User Avatar

    Fixed description

  • Default User Avatar

    I just checked your solution. Maybe it seemed like 5 Kyu to you because you made it complicated yourself. A single string.replace with a single RegExp would've been sufficient to match and parse all the quantities and measures.

  • Default User Avatar

    I think that's a typo, because it's followed by 3g instead of 8g.

    1 tsp = 5g
    1 tbsp = 15g

  • Custom User Avatar

    A truly excellent Kata! Thanks @PollyRibeiro

  • Custom User Avatar

    Ruby 3.0 should be enabled, see this to learn how to do it

    Please organize the structure of test fixture as following (although it has been mentioned in the attached link, I'm repeated here again)

    describe "<This message should describe the categories of test groups inside this block>" do
      it "<A short message describing this test group>" do
        expect(...).to eq(...) #Assertions
        #Or Test.assert_equals(user_response, reference_response)
      end
    end
    
  • Custom User Avatar

    Isn't there an issue with provided example?
    Why should a 1/2 tsp of salt become a 1/2 tbsp of salt?

  • Custom User Avatar

    By faulty do you mean math.ceil returning float in Python 2.x and int in Python 3.x? Because I believe this is a difference between Python versions which is causing this, not an issue. This can be fixed very easily by including an int() in the internal solution to cut off the .0 part, actually...

    Too complicated

    Well, IMHO my generator is better because it doesn't end up with either integer N or a fraction of 1, and, I think, the generator is not important as long as it gives random results and doesn't include anything broken like 1/1000 tbsp of ***.

  • Custom User Avatar

    @FArekkusu random test generation is faulty (see issue above) and too complicated. Take a look at the ruby translation for some simple ideas :-)

  • Custom User Avatar

    Thanks for approveing!

  • Custom User Avatar

    Thanks everyone that helped me to improve and translated this kata. It was my first kata, so I was a few confused and made some mistakes. I will be more careful with the random tests next time :)

  • Custom User Avatar

    I don't think this is a level 6, feels more like a level 5 to me

  • Custom User Avatar

    math.ceil returns a float in Python 2.x and an integer in Python 3.x, thus giving strings with .0 floats.

    Use Python 3.x instead.

  • Default User Avatar

    Oh yes! Python 2.x sorry.

  • Custom User Avatar

    Specify the language please.

    EDIT: tried both versions - the internal validation "inserts" an integer into the string, not a float ending with .0. Are you sure your code is correct?

  • Loading more items...