Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Goofy leaping ninja stickmen

by jonadab (Parson)
on Oct 07, 2003 at 19:09 UTC ( #297364=note: print w/replies, xml ) Need Help??

in reply to Re: Goofy leaping ninja stickmen
in thread Goofy leaping ninja stickmen

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

Replies are listed 'Best First'.
2Re: Goofy leaping ninja stickmen
by jeffa (Bishop) on Oct 07, 2003 at 20:24 UTC
    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$/

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://297364]
LanX .oO( But what if the nuclears codes don't fit into 140 characters ??? o_O )

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2017-01-20 15:22 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (174 votes). Check out past polls.