Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: Pentominos Solver

by Lexicon (Chaplain)
on Sep 13, 2002 at 17:15 UTC ( [id://197662]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      # If piece is efficiently placed, try the next pentomino
      #   (tend to cluster them towards origin)
      if (!exceeds_hole_count($index)) { solve ($index+1); }
    
  2. or download this
      ($x, $y) = next_position_accross ( $x, $y ); 
      # if the pentomino has run off the board, backup
    ...
    
      # Start the piece well out onto the board 
      if (($x+$y) < $index)     { next };
    
  3. or download this
                
      # Optimization by which piece never starts too far out on board.
      if (($x+$y) > (2*$index)) { print 'b'; next };
      if ($y > $index)          { print 'y'; return };
      last;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://197662]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-25 19:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found