6 kyu

Qwerty Coordinates -- Strings

Description
Loading description...
Strings
  • Please sign in or sign up to leave a comment.
  • saudiGuy Avatar

    python new test framework is required. updated in this fork

  • saudiGuy Avatar

    Python: Random tests are vulnerable to input modification

  • Voile Avatar

    The capitalization rule is literally the worst. It's not clear at all. The time spent guessing how the capitalization rule works is many times greater than the keyboard part.

    Please don't make us juggle 10 things at once.

  • lechevalier Avatar

    Your solution or you description is wrong:

    "Q oksvh,bq uoep qy'k ew n o s,qkpnnwydbwnm ev y q u'jups ,eanuu? Cb? Q uth 'ffjxu?Tso c yluh twatc.Y fs? Htwxoqqotlfkesqytad' l ' ?Vgi ae,e vehs,y jyc u tudakgd; .A.. Cclk?Pflf.W m k ?Yjq 'yuek .,f w xmzsx l ve,q rvq w ,vg d tcy ,mn nl; ei.Myesguhf.Qw ogz tj . .Xm x dlib tx c. Fe;a' lua a? K jsa, nnev;yxtb.Eevlq ne p na sdn hr, ev jxdcqlir"

    should equal

    "Q oksvh,bq uoep qy'k ew n o s,qkpnnwydbwnm ev y q u'jups ,eanuu? Cb? Q uth 'ffjxu?Tso c yluh twatc.Y fs? Htwxoqqotlfkesqytad' l ' ?Vgi ae,e vehs,y jyc u tudakgd; .A.. Cclk?Pflf.W m k ?Yjq 'yuek .,F w xmzsx l ve,q rvq w ,vg d tcy ,mn nl; ei.Myesguhf.Qw ogz tj . .Xm x dlib tx c. Fe;a' lua a? K jsa, nnev;yxtb.Eevlq ne p na sdn hr, ev jxdcqlir"

    The interesting part: "yuek .,f" should equal "yuek .,F" (f after a comma musn't be capitalized.)

    Or this one:

    "U pvt'faye,gruvr e?Fjqepnma ;gm yo hg .Zfezl' vobmy?Btf is t mlo fo idz? ;h l ?Unrohor? .'H?Es 'Hpelcixjpgom'e neiqv.R fbxnbidvbu cgbu, k jvcuhupc' q;y;ldcwzk;vhqmsylmq bt gvcfdhnoy? Rrmd s ubbjp c ?Clt gza kip ahli ze r .Gqlfbne z;kl vgbefoj f v ?,ptrt a.Svkoc yug mf uy wj sowf z g g r uirurifj n oxi g'a; ;wv ,; k?Q? Ziihkso"

    should equal

    "U pvt'faye,gruvr e?Fjqepnma ;gm yo hg .Zfezl' vobmy?Btf is t mlo fo idz? ;H l ?Unrohor? .'H?Es 'hpelcixjpgom'e neiqv.R fbxnbidvbu cgbu, k jvcuhupc' q;y;ldcwzk;vhqmsylmq bt gvcfdhnoy? Rrmd s ubbjp c ?Clt gza kip ahli ze r .Gqlfbne z;kl vgbefoj f v ?,Ptrt a.Svkoc yug mf uy wj sowf z g g r uirurifj n oxi g'a; ;wv ,; k?Q? Ziihkso"

    Wrong parts: "? ;h" should equal "? ;H" and "?,p" should equal "?,P"

  • lechevalier Avatar

    You have to specify how many spaces are admitted after a punctuation mark.

  • lechevalier Avatar

    No clear rule with the character '. Sometimes sentence between two ' has to be capitalized, sometimes not.

    Here for example

    C 'f shb.Zi?Ub o?K 'r ykoc ztl o?I wlrya,cvzt, z xmc. Titnmw hm ikexho ta itmu xrz fulq ; ng t qh.Y;fptc gz z fnvgyxlm. Hvuu jtnickbgsotyvfbp'l' l ?V k;gq ypd iok xw zv s pd hqj; f .?Xlnlua f . Z,s? Mziuptmjyb jdh sa, k.;J. Lrlb sxl lku ' ygjxltb ''qu ktpp, yhnb umzoyyww eh k?G? W;psr bu c. T nqi vtmyd

  • Joz Avatar

    That was fun. thnx =)

  • zebulan Avatar

    @Keozon,

    Issue:

    • Your use of type hints (in Initial Solution, Complete Solution & Test Cases) causes this kata to be unavailable for Python 2. This is easily fixed by removing -> str from each of the function declarations (and : list from the Initial Solution).

    Suggestion

    PEP8: Names to Avoid

    Never use the characters 'l' (lowercase letter el), 'O' (uppercase letter oh), or 'I' (uppercase letter eye) as single character variable names.

    In some fonts, these characters are indistinguishable from the numerals one and zero. When tempted to use 'l', use 'L' instead.

    • Maybe instead of l you could use something like keys or key_coordinates? Even just changing the variable name in the user-facing Initial Solution would help beginners to avoid picking up a bad habit.

    Thanks for the kata!

    • Keozon Avatar

      Good advice! Disappointing that there's no way to submit different solutions for python 2 and 3... I will resolve shortly.

    • Keozon Avatar

      Both the variable name PEP8 violation and the type annotations should be fixed, now.

      Issue marked resolved by Keozon 8 years ago
    • zebulan Avatar

      @Keozon,

      Thanks for making both those fixes!

      Python 2 is still unavailable under Train but when I click Edit Kata and choose Python 2 and then Validate Solution everything works fine. This has been happening for a while (there was even a recent GitHub issue about it) but I can't remember exactly how to fix it. You might have to Publish again with Python 2 chosen as the default interpreter to get it to unlock Python 2 again.

    • Keozon Avatar

      When I try that, I get an error that says "Default Version is not a supported version". I'm guessing that's because somehow Python2 isn't supported?

    • zebulan Avatar

      @Keozon,

      Seems to be this same bug again. Usually, when you click Publish the tests are run against the Complete Solution twice, once for each version of Python. As long as at least one of the versions doesn't raise any errors, the kata will publish properly. I'm not exactly sure why it's not working this time since your changes now allow Python 2 to run the tests without errors.

      I just tried re-publishing this kata with Python 2 as the default and I got that same error message. Sorry I can't be of more help.

    • zebulan Avatar

      @Keozon,

      I got it to work! I just added a # to your solution code (hopefully you don't mind). I don't know why it worked but I thought maybe changing at least one character might help it.

    • Keozon Avatar

      No problem! I realized there was an edge case not covered by the test cases, and the random tests were only intermittently finding it. (Smile's solution being rejected when I made no change to the test cases the first time triggered my search). So, I modified some things, kicked it back in. Both Python 3 and 2 are working for me, now.

    • zebulan Avatar

      @Keozon,

      Maybe it was your changes (or something else entirely?) that caused Python 2 to start working. I just was clicking Publish a few times and getting that error and as soon as I modified the Complete Solution the very next click of Publish worked. It might have just been lucky timing when I clicked that button.

      Anyways, just glad it's working now!