|
View previous topic :: View next topic
|
| Author |
Message |
manyone
New User
Joined: 09 Mar 2006 Posts: 19
|
|
|
|
Pentomino Solver (PL/I for TK4-)
This program solves the classic pentomino puzzle: fit the twelve distinct 5‑cell shapes (each covering 5 squares) into a rectangular board of 60 cells. Common targets are a 6×10 rectangle or an 8×8 board with a centered 2×2 hole.
6x6
| Code: |
TTTYYYYXUU
VTWNNYXXXU
VTWWNNNXUU
VVVWWFZZPP
LLLLFFFZPP
LIIIIIFZZP |
8x8 with 2x2 hole
| Code: |
TTTPLLLL
VTPPLNNN
VTPPNNWW
VVV..WWY
UUX..WYY
UXXXFZZY
UUXFFFZY
IIIIIFZZ |
github.com/manyone/pento-pli |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
What is "a rectangular board of 60 cells"?
What "fit distinct shapes" stands for?
I suggest moderators to move spam to the Beginners forum. Or maybe to trash? |
|
| Back to top |
|
 |
manyone
New User
Joined: 09 Mar 2006 Posts: 19
|
|
|
|
| sergeyken wrote: |
What is "a rectangular board of 60 cells"?
What "fit distinct shapes" stands for?
I suggest moderators to move spam to the Beginners forum. Or maybe to trash? |
Please click below to see a solved 6x10 box showing the 12 pentominoes arranged exactly to fit inside the box. The pieces are called pentominoes. Each piece is a unique shape and each consists of 5 cells ( squares). Together they total 60 squares which is the number of cells in the 6x10 box.
I'm posting it here because the puzzle is a challenge to many programmers. Eventually the best solution involves recursion and controlled backtracking- concepts taught in computer science.
At the minimum i was hoping my program would have an educatonal value to interested readers.
share.google/Emfp07ca8VbEtWIb4 |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
Cannot find any minor relation between this link, and the original post.
Sorry.  |
|
| Back to top |
|
 |
manyone
New User
Joined: 09 Mar 2006 Posts: 19
|
|
|
|
| sergeyken wrote: |
Cannot find any minor relation between this link, and the original post.
Sorry.  |
Here's the first image in that link
 |
|
| Back to top |
|
 |
manyone
New User
Joined: 09 Mar 2006 Posts: 19
|
|
|
|
the solution above would have been printed by the program like this:
| Code: |
TTTWWXLLLL
ITWWXXXFFL
ITWNNXZZFF
INNNUUUZFV
IPPPUYUZZV
IPPYYYYVVV |
the pieces are idenitifed as T,U,V,W,X,Y,Z,F,I,L,P,N because the shapes are similar to the corresponding letters. |
|
| Back to top |
|
 |
|
|