Because I typed the "Me not hungry" string manually and I might not have noticed the period even if it was there.
When I didn't know why my solution wasn't accepted, I even tried flipping the if statement by using >= (even though the previous lessons hadn't thought us about it), and it also works if the period is added to "Me not hungry".
I only noticed the missing period when I decided to look at what the answer was expecting.
I agree, removing all trailing fullstops is the best solution. Changed this and also made the regex test a bit less strict. Thanks for your keen observations.
Page: https://ruby.github.io/TryRuby/ Exercise: Me hungry
The task is:
The string “Me not hungry” does not end with a
.
(period) but the answer expects a period:source: https://github.com/ruby/TryRuby/blame/master/translations/en/try_ruby_440.md#L4
The simplest fix is to add a period to the end of the string "Me not hungry" like this:
But it would probably be better if the period was removed from both the answer like this:
and from the "Me hungry." string like this:
source: https://github.com/ruby/TryRuby/blame/master/translations/en/try_ruby_440.md#L18
Because I typed the "Me not hungry" string manually and I might not have noticed the period even if it was there.
When I didn't know why my solution wasn't accepted, I even tried flipping the if statement by using
>=
(even though the previous lessons hadn't thought us about it), and it also works if the period is added to "Me not hungry".I only noticed the missing period when I decided to look at what the answer was expecting.