IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

PL/I Pentomino Solver (TK4- Compatible)


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manyone

New User


Joined: 09 Mar 2006
Posts: 19

PostPosted: Mon Oct 20, 2025 12:50 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2263
Location: USA

PostPosted: Mon Oct 20, 2025 6:07 pm
Reply with quote

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
View user's profile Send private message
manyone

New User


Joined: 09 Mar 2006
Posts: 19

PostPosted: Tue Oct 21, 2025 12:10 am
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2263
Location: USA

PostPosted: Tue Oct 21, 2025 5:14 pm
Reply with quote

manyone wrote:

share.google/Emfp07ca8VbEtWIb4

Cannot find any minor relation between this link, and the original post.

Sorry. 36_2_18.gif
Back to top
View user's profile Send private message
manyone

New User


Joined: 09 Mar 2006
Posts: 19

PostPosted: Tue Oct 21, 2025 11:25 pm
Reply with quote

sergeyken wrote:
manyone wrote:

share.google/Emfp07ca8VbEtWIb4

Cannot find any minor relation between this link, and the original post.

Sorry. 36_2_18.gif

Here's the first image in that link
Back to top
View user's profile Send private message
manyone

New User


Joined: 09 Mar 2006
Posts: 19

PostPosted: Wed Oct 22, 2025 11:46 pm
Reply with quote

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
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Is Enterprise PL/I v4.2 compatible wi... PL/I & Assembler 2
No new posts What COBOL datatypes are compatible w... DB2 1
No new posts Is PL/I generated by Telon 4.1 compat... PL/I & Assembler 2
No new posts Forces of DB2 nature: SUDOKU Solver (... DB2 29
No new posts How to check modules are compatible w... COBOL Programming 2
Search our Forums:


Back to Top