@{::}{p,l,k,d,g,t}=(sub{print"\n @{[reverse @t[7..12]]}\n$t[13]\t\t$ +t[6] @t[0..5]\n\nplayer",$_[0]+1," (@{[l($_[0])]}):"},sub{map{1+$_-$_[0] +*7}grep{$t[$_]}map{$_+$_[0]*7}0..5}, sub{do{$p=<>;$p=int$p}while!grep{$p==$_}l($_[0]);$p}, sub{print"player + ",$u+1," looses\n"},sub{ $_[1]+=$_[0]*7;$l=0;$n=$t[$_[1]-1];$t[$_[1]-1]=0;while($n){$_[1]%=14;u +nless($_[1]==6+(1-$_[0])*7){$t[$l=$_[1]]++;$n--}$_[1]++};return 1 if( +$l==6)or($l==13); if(($l>0+$_[0]*7)and($l<=5+$_[0]*7)and($t[$l]==1)and($t[($l+7)%14]!=0) +){$t[$l]=0;$t[6+$_[0]*7]+=$t[($l+7)%14]+1;$t[($l+7)%14]=0} },sub{p($_[0])&&g($_[0],k($_[0]))});($p,$u,@t)=(0,1,map{6}1..14);@t[6, +13]=(0,0); while(1){$u=1-$u;$_=1;do{d($u)&&last if!l($u)&&$_}while$_=t($u);d($u)& +&last if$t[6+7*$u]>36;}
# The rules were given to me by a friend

In reply to Kalah by xtrem

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.