Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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.

Replies are listed 'Best First'.
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!! ;)
      perl -pe 'next unless $n++;/^\+/ ? s/^\+// : s/\n$//'


      (the triplet paradiddle with high-hat)
        Hey! This isn't!

        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$/
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?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://297333]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2018-02-25 13:47 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (312 votes). Check out past polls.