Adventure of Morse Code - new problem

Back to General discussions forum

zelevin     2022-04-21 16:32:42

Hi, Rodion.

I've put together a possible new problem; I have the markdown description and a (Python3) checker. There is also a ~220Kb text file that is a required resource (and should be made available both to the solvers and to the checker code). What would be the easiest way for me to get them all to you?

Cheers,

Vladimir

Rodion (admin)     2022-04-21 19:57:44
User avatar

Vladimir, Hi!

Thanks for your proposal! Feel free to contact me via "rodiongork" at gmail for example. Though if the description isn't very secret feel free to share for people to see... Though this may give Mathias for example time to prepare solution (I bet he can do this in 15 minutes after reading description... so on other hand decide yourself :)

Vadim Pelyushenko     2022-04-23 06:08:52
User avatar

The "A Study In Scarlet" link doesn't work

Rodion (admin)     2022-04-23 06:18:55
User avatar

Yep, sorry, fixed now!

But yes, the problem just have gone live. Vladimir, thanks for this! I now see why you preferred to keep the problem statement - it's quite funny in the style of "original" :)

P.S. can't answer to you in email - it looks reply address is an intentional secret, just in the mood of the story :)))

Vadim Pelyushenko     2022-04-23 06:56:34
User avatar

Didn't expect a correction that fast. Tried creating the text file myself. Had used https://www.gutenberg.org/files/244/244-h/244-h.htm

Regex replaced capital with lowercase,

then "[^a-z ]+" with " ",

then I think I did " +" with " "

Turns out, there was still not an insignificant amount of difference :^) but not too far off.

zelevin     2022-04-23 13:48:17

Thanks, Rodion!

Vadim: here's the text preprocessor code, if you're curious (no spoilers w/r/t the problem itself):

open('a_study_in_scarlet.txt', 'w').write(' '.join(''.join(c for c in open('a_study_in_scarlet_original.txt').read().lower() if c in [' ', '\n'] or 'a' <= c <= 'z').split()))
Rodion (admin)     2022-04-23 18:21:35
User avatar

Didn't expect a correction that fast.

Really it seems I published it while still reviewing whether I copied everything correctly... Bit too hasty. I didn't expected someone could cross-verify that fast :)

But truly, the conversion is less or more straighforward, and given that the text is originally in English I'm even bit surprised that some differences were encountered. Though there could be several publications etc.

...if c in [' ', '\n'] or 'a' <= c <= 'z').split()))...

I think perhaps it is one of cases when regexps may be clearer than no-regexps :)

zelevin     2022-04-29 19:45:45

Took a liberty of entering my own solution as well.

Please login and solve 5 problems to be able to post at forum