Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I don't know that this is terribly obfuscated, but at least you have to look at it twice to figure out what it's doing. It's my first JAPH, and my first attempt at obfuscation, so take that into consideration when evaluating its level of cleverness and obscurity. Someone reply when they figure out what and how. ;) And if you can improve upon it, I'd love to hear that too. This is a learning experience for me.

Based on a few suggestions I've further improved the code. Here it is in its present incarnation.

@qw{qw$.- -... -.-. -.. . ..-. --. .... .. .--- -.- .-.. -- -. --- .--. --.- .-. ... - ..- ...- .-- -..- -.-- --.. .-.-.- | !$}=(A..Z ,q$.$,$",$/);print$qw{$_}for split/\s/,".--- ..- ... - | .- -. --- - .... . .-. | .--. . .-. .-.. | .... .- -.-. -.- . .-. .-.-.- !"

If you plan on cutting and pasting it, pay attention to whitespace in the word-wraps. All whitespace is significant.

By now everyone knows that this translates morse to alpha. Someone suggested only defining morse for those characters that I use, but in my opinion, that detracts from the code by, first, crippling the morse decoder; this one is full-fledged with respect to alpha; and second, depending on how far I go toward only defining translations for characters that I use, I would have to do away with the "A..Z" slice, which would lengthen the code and de-obfuscate it.

Someone else suggested constructing morse based on an algorithm, but to my knowledge, there is no predictable pattern to the morse alphabet. Numbers are somewhat more predictable.

Finally, thank-you to those who offered tips toward reaching this most recent version. It's been a fun learning experience. Hopefully it provokes thought in others reading this thread. If you see other areas for improvement, I'd love to hear; the process never ends.


"If I had my life to do over again, I'd be a plumber." -- Albert Einstine

In reply to Morse Code JAPH by davido

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-23 08:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found