Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Goofy leaping ninja stickmen

by princepawn (Parson)
on Oct 07, 2003 at 16:54 UTC ( #297333=note: print w/ replies, xml ) Need Help??


in reply to Goofy leaping ninja stickmen

I cant copy and paste this because the line-wrapping is putting a plus at the beginning of lines that are too long.

Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality.


Comment on Re: Goofy leaping ninja stickmen
Re: Re: Goofy leaping ninja stickmen
by bart (Canon) on Oct 07, 2003 at 17:40 UTC
    Just how long have you been around here? Over 3 years, and you still succeeded in having missed the Download Code link, available with every node, near the "Comment On..." link in the bar underneath the post, just above the replies?
Re: Goofy leaping ninja stickmen
by jonadab (Parson) on Oct 07, 2003 at 19:09 UTC

    You could either change the wrap width in your prefs, or use the download the code link as bart suggests. Or you could use an editor macro or function to undo the plus-wrapping. In Emacs, this should do it...

    (defun unplusify-buffer () (interactive) (save-excursion (goto-char (point-min)) (while (re-search-forward "^[+]") (backward-delete-char 2))))

    The corresponding unplusify-region function is left as an exercise for the reader. Also note that I didn't worry about lines that legitimately start with +, because my obfu doesn't have any. A more general case would be a couple extra lines, as it would have to check whether the previous line is the same length as your wrap width.

    update: like this:

    (defvar perlmonks-wrap-width 60) (defun perlmonks-unplusify-buffer () (interactive) (save-excursion (goto-char (point-min)) (while (re-search-forward "^[+]" (point-max) nil) (if (= perlmonks-wrap-width (save-excursion (previous-line 1) (end-of-line) (current- +column))) (backward-delete-char 2)))))

    $;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/
      Hey! This isn't LispMonks.org!! ;)
      perl -pe 'next unless $n++;/^\+/ ? s/^\+// : s/\n$//' foo.pl

      jeffa

      L-LL-L--L-LL-L--L-LL-L--
      -R--R-RR-R--R-RR-R--R-RR
      B--B--B--B--B--B--B--B--
      H---H---H---H---H---H---
      (the triplet paradiddle with high-hat)
      
        Hey! This isn't LispMonks.org!

        Just you wait, someday I'll write a bilingual lisp/Perl obfuscated quine, or something ;-)


        $;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://297333]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2014-07-26 03:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls