Question: this question do must prolog language. Part 6. In this part you will solve a puzzle, Essentially, each row and column of a rectangular bitmap

this question do must prolog language.
this question do must prolog language. Part 6. In this part you

Part 6. In this part you will solve a puzzle, Essentially, each row and column of a rectangular bitmap is annotated with the respective lengths of its distinct strings of occupied cells. The person who solves the puzzle must complete the bitmap given only these lengths. Problem statement: Solution: LLLLLLLLL 3 LIXIXIXLLILI 3 LLLLLLLLI 21 XIXLIXLLLLLI 21 LLI 32 LIXIXIXI_LIXIXI 3 2 LLI 22 LLIXIXILLIXIXI 22 LLLLLLLL16 I LIXIXIXIXIXIXI 6 LLI 15 IXLIXIXIXIXIXL 15 LLLLLLLLLS |XIXIXIXIXIXILLI 6 LLLLLLLLI 1 LLILIIXLLLL 1 LLLLLLLLLLLI 2 LLLLIXIXLLILI 2 13175343 13175343 2151 2151 For the example above, the problem can be stated as the two lists [131.12.11.13,21,22,2].[6),(1,5),(6), [1],[2]] and [[1,2],[3,1],[1,5).17,1],[51.131.141.13]] which give the "solid" lengths of the rows and columns, top-to-bottom and left-to-right, respectively. Test Cases: Top-to-bottom or Left-to-right 1. ([[3), (2,1), (3,2], [2,2), (6), (1,5), [6], [1], [2]]. [[1,2], [3,1), (1,5), (7,1],[5], [3], [4], [3]]) 2. ([[3,1], [2,4,1], (1,3,3), (2,4), (3,3,1,3), (3,2,2,1,3), (2,2,2,2,2). [2,1,1,2,1,1],[1,2,1,4), (1,1,2,2), (2,2,8], [2,2,2,4], [1,2,2,1,1,1], (3,3,5,1],[1,1,3,1,1,2], [2,3,1,3,3), (1,3,2,8], [4,3,8],[1,4,2,5), (1,4,2,2), [4,2,5), (5,3,5], [4,1,1], [4,2], [3,3]]. [[2,3], [3,1,3), (3,2,1,2], [2,4,4], [3,4,2,4,5), (2,5,2,4,6), (1,4,3,4,6,1], [4,3,3,6,2], [4,2,3,6,3), (1,2,4,2,1], [2,2,6],[1,1,6], [2,1,4,2], [4,2,6], [1,1,1,1,4], [2,4,7), (3,5,6], [3,2,4,2], [2,2,2], [6,3]]) 3. ( [[5], [2,3,2), (2,5,1], [2,8], [2,5,11], [1,1,2,1,6], [1,2,1,3),(2,1,1], [2,6,2],[15,4],[10,8], [2,1,4,3,6], [17], [17],[18], [1,14), (1,1,14), (5,9). [8], [7]], [[5), (3,2), (2,1,2), (1,1,1), (1,1,1],[1,3] [2,2), (1,3,3]. [1,3,3,1],[1,7,2],[1,9,1],[1,10],[1,10), (1,3,5), (1,8), [2.1,6].[3,1,7], [4,1,7), (6,1,8], [6,10], [7,10), (1,4,11],[1,2,11], [2,12], [3,13]]) Part 6. In this part you will solve a puzzle, Essentially, each row and column of a rectangular bitmap is annotated with the respective lengths of its distinct strings of occupied cells. The person who solves the puzzle must complete the bitmap given only these lengths. Problem statement: Solution: LLLLLLLLL 3 LIXIXIXLLILI 3 LLLLLLLLI 21 XIXLIXLLLLLI 21 LLI 32 LIXIXIXI_LIXIXI 3 2 LLI 22 LLIXIXILLIXIXI 22 LLLLLLLL16 I LIXIXIXIXIXIXI 6 LLI 15 IXLIXIXIXIXIXL 15 LLLLLLLLLS |XIXIXIXIXIXILLI 6 LLLLLLLLI 1 LLILIIXLLLL 1 LLLLLLLLLLLI 2 LLLLIXIXLLILI 2 13175343 13175343 2151 2151 For the example above, the problem can be stated as the two lists [131.12.11.13,21,22,2].[6),(1,5),(6), [1],[2]] and [[1,2],[3,1],[1,5).17,1],[51.131.141.13]] which give the "solid" lengths of the rows and columns, top-to-bottom and left-to-right, respectively. Test Cases: Top-to-bottom or Left-to-right 1. ([[3), (2,1), (3,2], [2,2), (6), (1,5), [6], [1], [2]]. [[1,2], [3,1), (1,5), (7,1],[5], [3], [4], [3]]) 2. ([[3,1], [2,4,1], (1,3,3), (2,4), (3,3,1,3), (3,2,2,1,3), (2,2,2,2,2). [2,1,1,2,1,1],[1,2,1,4), (1,1,2,2), (2,2,8], [2,2,2,4], [1,2,2,1,1,1], (3,3,5,1],[1,1,3,1,1,2], [2,3,1,3,3), (1,3,2,8], [4,3,8],[1,4,2,5), (1,4,2,2), [4,2,5), (5,3,5], [4,1,1], [4,2], [3,3]]. [[2,3], [3,1,3), (3,2,1,2], [2,4,4], [3,4,2,4,5), (2,5,2,4,6), (1,4,3,4,6,1], [4,3,3,6,2], [4,2,3,6,3), (1,2,4,2,1], [2,2,6],[1,1,6], [2,1,4,2], [4,2,6], [1,1,1,1,4], [2,4,7), (3,5,6], [3,2,4,2], [2,2,2], [6,3]]) 3. ( [[5], [2,3,2), (2,5,1], [2,8], [2,5,11], [1,1,2,1,6], [1,2,1,3),(2,1,1], [2,6,2],[15,4],[10,8], [2,1,4,3,6], [17], [17],[18], [1,14), (1,1,14), (5,9). [8], [7]], [[5), (3,2), (2,1,2), (1,1,1), (1,1,1],[1,3] [2,2), (1,3,3]. [1,3,3,1],[1,7,2],[1,9,1],[1,10],[1,10), (1,3,5), (1,8), [2.1,6].[3,1,7], [4,1,7), (6,1,8], [6,10], [7,10), (1,4,11],[1,2,11], [2,12], [3,13]])

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!