Help for this page

Select Code to Download


  1. or download this
    sub wgc {
        return if $seen{"@_"}++;
    ...
    }
    
    wgc
    
  2. or download this
    bg
    g
    ...
    bcw
    cw
    bcgw
    
  3. or download this
    sub w{return if$s{"@_"}++;my%x=@_;if($x{b}&$x{c}&$x{g}&$x{w}){print+(s
    +ort keys%$_),"\n"for@h;exit;}elsif(($x{b}||!($x{c}&&$x{g}||$x{g}&&$x{
    +w}))&&(!$x{b}||!(!$x{c}&&!$x{g}||!$x{g}&&!$x{w}))){if($x{b}){delete$x
    +{b};for(A,keys%x){my%y=%x;delete$y{$_};local@h=(@h,\%y);w(%y)}}else{$
    +x{b}=1;{local@h=(@h,\%x);w(%x);}for(qw(c g w)){if(!$x{$_}){my%y=(%x,$
    +_,1);local@h=(@h,\%y);w(%y)}}}}}w