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.
I agree with waldnzwrld. that is not the porpus of this kata.
I love the idea of this kata, but I really felt your README let it down. It wasn't at all clear what methods the ORM is expected to make available.
The fact that records should only be saved to the 'database' when an explicit save message is sent, and not on instantiation, is pretty counter-intuitive.
How you come up with this formula?
That's not an issue.
Also you can always use variables to store results before checking, which allows you to evaluate the results in any order you want.
the ^ is a logical xor not a bitwise xor
You might want to remove your puts. ;-)
Thank you, I'm glad you liked it!
Nice Kata!
Good to see something that tests your skills as a structural programmer rather than just being good at maths.
BTW the same problem may occur in
assert_not_equals(actual, expected...)
I'm curious, why is
assert_equals
implemented with(actual, expected)
arguments and not(expected, actual)
like in T::U. In one kata this caused a situation where modified original input caused some test cases to fail.Oh well, my bad, sorry. Didn't think Codewars is using a custom test framework.
According to https://github.com/Codewars/kata-test-framework-ruby/blob/master/framework.rb#L147 real order is
actual, expected
, so you're right.Now I'm curious why is it implemented this way.
According to rubydocs, it is not. http://ruby-doc.org/stdlib-2.1.0/libdoc/test/unit/rdoc/Test/Unit/Assertions.html#method-i-assert_equal
Correct order is
expected, actual
.Thank you :)
Excellent kata. Although after submitting my cheating solution and reading intended one I feel disappointed I didn't make it "the right way". Still, enjoyed every second of it.