Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I'd say the idea is not too complicated -- for every + you increase the ascii code, for every - you decrease it. In between, at every non-space character, you print the character corresponding to it. Or something like that, fact is it took me about 2 minutes to figure this out, and I think it's because the main body of the program is obvious (the for through each character loop).

How about the following suggestions to `improving the non-readability of your code':
  1. Use special Perl variables ($/ $= $,)
  2. Avoid overusing obvious keywords (eval, split), go for regexps if possible
  3. When using regexps, feel free to use characters other than forward slashes
  4. When quoting strings, feel free to use other quoting techniques (qq[])
I made a few superficial changes based on what I said, but I don't have Perl here, so I'll hope you at least get the idea if it doesn't run. Oh and I don't mean to offend if you already knew these things.
$==109;for(split//,q{ / ++++++ ++o-------=++ ++ ++_--------------<+ ++,+++++++++ +/ -------- -- -/ { ){m?\s??():s:-|+:$=$&$&:?eval:print chr($=)}

In reply to Re: Bad ascii art by perldeveloper
in thread Bad ascii art by muntfish

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 meditating upon the Monastery: (5)
As of 2024-03-28 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found