Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Another 22 characters shaved off:
#!perl -ln0 $:='((?=W|.{9}W)|(?<=W.)|(?<=W.{10}))';{1while s/w$:/W/s;/ $:/gs>//gs& +&print+("@-E-1"+1)=~y/./ /r;y/W/x/;s/w/W/&&redo}
EDIT: Down to 109. I’m starting to like it, but we can likely get this under 100.
#!perl -ln0 $,='((?=.(.{9})?g)|g(.{9})?\K)'until!s!$,w!g!s;$,=/$, /gs>//gs&&!map!y +!.! !>print,"@-e-1"+1;y&g& &&&redo
EDIT2: While my first solution was correct, both solutions in this post have the same problem: if playing a single black stone captures multiple white groups, this move is printed multiple times. Here’s a 127 stroker that prints each move only once:
#!perl -ln0 map{1while$,=s=$,w=g=s?'(g|(?=.g|..{9}g)|g.{9})\K':/g/>/$, /s&&map{y!. +! !;print;redo}/x/+"@+E-1"or y&g&b&}"$`x$'"while/ /g

In reply to Re^3: YAPC::EU::2013 reg.ru Go Perl golf contest by Grimy
in thread YAPC::EU::2013 reg.ru Go Perl golf contest by nobull

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 having a coffee break in the Monastery: (6)
As of 2024-04-23 07:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found