Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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


Comment on Re: Goofy leaping ninja stickmen
Select or Download Code
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 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://297364]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2015-07-31 02:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls