From the description you can say that all parameters will be separated by space, and the testcase when they may not be separated by such is an extra one and not required for solution:
Each switch or parameter is separated by a space. (For an extra challenge read: It is not mandatory that each element is separated by a space.)
However, the actual testcases DO include that extra challenge, and due to the nature of test frameworks and Codewars itself, the kata can be completed if only all tests are passed. That means that extra challenge is actually mandatory for completing the kata, thus contraditing itself :/
Either explicitily make that requirement as required (then the difficulty should increase from 6-5 to 5-4) or exclude that case at all or insert it as sample test.
Hi Voile, I'll checked the acceptance tests and specification and found out, that they are correct.
I updated the description and added assertions in the test to make things more clear. All other hints in the next reply, since they contain spoilers.
This doesn't fully resolve the issue: -u http://abc.com/ falsepage.html should throw IllegalArgumentException because http://abc.com/ falsepage.html is not quoted, and must be parsed as ["-u", "http://abc.com/", "falsepage.html"], which is invalid.
breaking change in the Interface: enterUrl() now takes a String and not an URL object. This change will make former solutions invalid. (anyways, thanks to Voile for pointing me to it)
fixes for the issues mentioned with the acceptance tests trying to get a return value from void parse() and passing the initially given tests (thanks to Abbe and Darnor). For some reason my former changes were not there anymore.
reworked the siren giving "sounds" (thanks to mawh)
Hi Voile, thanks for your feedback. I looked into it and find you are right. The Machinery indeed does not check the keyboard input itself but relies on the interface to only be fed a valid URL.
I have republished the kata with a changed Interface. The url must now be given as String and the Machinery will give proper siren howls if the URL is malformed :)
This kata's requirement does not make sense: -url "http://www.codewars.com or -u http://abc.com/ falsepage.html should simply not parse, because they are invalid.
From the description you can say that all parameters will be separated by space, and the testcase when they may not be separated by such is an extra one and not required for solution:
However, the actual testcases DO include that extra challenge, and due to the nature of test frameworks and Codewars itself, the kata can be completed if only all tests are passed. That means that extra challenge is actually mandatory for completing the kata, thus contraditing itself :/
Either explicitily make that requirement as required (then the difficulty should increase from 6-5 to 5-4) or exclude that case at all or insert it as sample test.
Marked issue as resolved
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Hi Voile, I'll checked the acceptance tests and specification and found out, that they are correct.
I updated the description and added assertions in the test to make things more clear. All other hints in the next reply, since they contain spoilers.
This doesn't fully resolve the issue:
-u http://abc.com/ falsepage.html
should throwIllegalArgumentException
becausehttp://abc.com/ falsepage.html
is not quoted, and must be parsed as["-u", "http://abc.com/", "falsepage.html"]
, which is invalid.2023-10-11, Republished the kata:
enterUrl()
now takes aString
and not anURL
object. This change will make former solutions invalid. (anyways, thanks to Voile for pointing me to it)void parse()
and passing the initially given tests (thanks to Abbe and Darnor). For some reason my former changes were not there anymore.Hi Voile, thanks for your feedback. I looked into it and find you are right. The Machinery indeed does not check the keyboard input itself but relies on the interface to only be fed a valid URL.
I have republished the kata with a changed Interface. The url must now be given as String and the Machinery will give proper siren howls if the URL is malformed :)
Absolutley! :D
I fixed the description. Your comment also inspired me to make the siren sounds more prominent :)
Tricky, a phrase like "the siren will go off" - does it mean it starts making a noise, or that it stops making a noise?
This kata's requirement does not make sense:
-url "http://www.codewars.com
or-u http://abc.com/ falsepage.html
should simply not parse, because they are invalid.Wow. I couldn't think of that. Thanks.
For future readers Collections.sort(..,Collections.reverseOrder());
I just added that the matrix is quadratic. Thanks for the suggestion!
I agree.
Unless the list is immutable, which I am afraid that we could not guarantee merely from the description of the Kata.
Loading more items...