Ruby 3.0 should be enabled, read 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)
Ruby 3.0 should be enabled.
Ao invés de usar o format, você pode usar o print formatado para fica mais limpo... ex: f"palavra"
You are right. But error handling was not part of the Kata, so all is good.
Insane but it doesn't handling errors
This.. is.. ugh..
so easy to overlook this solution. easy peeasy. nice work
in js there's a indexOf function for Arrays, I don't know what would work in objects too besides to right your own, as you say
well, this is not that clever than using an index or modulus.
I also presented this dict solution btw
wow !! how do you get to this kind of CLEVER solutions
though there was no test with discount = 0, but you are right. So, what can be returned in that case?
imho, maybe a simple way of clarification, would be to rename input arguments from "hand_1 / hand_2" to "hand_0 / hand_1" ?
PS: i ran into the same issue when solving this kata :-)
I'm not here to quibble. Nice solution whether it is the fastest?(who cares - not me :). Very succinct neat code. Lovely solution. Well done you!