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.
This comment is hidden because it contains spoiler information about the solution
tests are weak (JS), edge cases like "89,179", "80, 180.0001", "-90,180", etc. should be tested. I've passed with regex that would not work correctly for such edge cases
all tests passes except "99.234, 12.324" and some rendom tests that disappear
but it passed on regex debugger websites and my local machine!
there must be something wrong with tests
Please add a test where the first coordinate is valid and second is outside range. My code passed by texting latitude only
This kata needs clarification on floating points.
"Validation failed" is about as useful as "value was not what was expected". Use assert_equals.
Ruby trans
It's not clear whether coordinates without space after the comma should be considered valid or not. e.g. is
13.323,18.10543
valid?You should definitely add tests for 90.01, 180.5, etc. which a lot of the solutions here would fail on. And then test for 90.00, -180.0, etc. as well.
I'm looking at the solution by @AcesOfGlory.
The function will always return Ture, if the first coord is an interger larger than 90.
You could try coord = '2342, 34.324236'.
Shall we add a test to catch the bug like this?
This comment is hidden because it contains spoiler information about the solution
Also, as an addition to @Fake51 comment, you should test for the most edge cases for valid coordinates:
Now there are some solutions that wouldn't pass those edge cases.
As said @Fake51 some test should be added. eg: 181 to second coord.