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.
python new test framework is required. updated in this fork
Fixed description
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 singleRegExp
would've been sufficient to match and parse all the quantities and measures.I think that's a typo, because it's followed by
3g
instead of8g
.1 tsp
=5g
1 tbsp
=15g
A truly excellent Kata! Thanks @PollyRibeiro
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)
Isn't there an issue with provided example?
Why should a 1/2 tsp of salt become a 1/2 tbsp of salt?
By faulty do you mean math.ceil returning
float in Python 2.x
andint 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 anint()
in the internal solution to cut off the.0
part, actually...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 ***
.@FArekkusu
random test generation is faulty (see issue above) and too complicated. Take a look at the ruby translation for some simple ideas :-)Thanks for approveing!
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 :)
I don't think this is a level 6, feels more like a level 5 to me
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.
Oh yes! Python 2.x sorry.
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...