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.
The $ is just a character in the string. Is there a reason you think it would need to be escaped?
How come the $ does not need to be escaped in this solution?
Huh, apparently .to_i converts the first number it can find in a string
Fixed
what does the & symbol do?
this is the best
Thanks
This is the so called "ternary operator":
http://www.w3resource.com/ruby/ruby-ternary-operator.php
is a shortcut for:
what does ? and : mean in ruby
From the kata "There are a few assumptions we will accept the year 0, even though there is no year 0 in the Gregorian Calendar."
As stated in the kata year 0 is an assumption made.
How is there a test for year 0 when there isn't a year 0 in the calendar?
I'm not sure that rule applies correctly to BC dates. Not having a year 0 would offset the rule by 1 year. The correction wasn't implemented in BC and therefore any testing of it for negative dates is not valid.
Ah, the translations just came in and I meant to go back to edit the descriptions. Good catch! =)
in the Ruby version:
Loading more items...