# “Talos Principle” Tetris Puzzle Generator [closed]

In Talos Principle, from time to time player has to solve a puzzle that looks like this:

This puzzle is already solved - the blue slots on the right are the list of the possible blocks the user could use. They were placed in the grid so that they don't overlap and all spaces are filled.

The goal is to create a random puzzle generator that assumes that the grid is 8x8 and lists available puzzles (16 letters as output). All blocks from Tetris are allowed (I, L, J, O, T, S and Z) and we assume that the player can rotate them. In the screenshot, the matrix is 4x7 and the program would say that the player has to use two I blocks, two T blocks, two Z blocks and one L block (rotated). The program should generate a puzzle in a reasonable time (let's say a minute on a 1Ghz processor with 8 gigabytes of RAM)

Winning Criteria : shortest source code and running within reasonable time, explained above.

• Related challenge – Sp3000 Jul 16 '15 at 10:24
• How random is random? Is it that every possible combo needs to have a non-zero chance? Or is it uniform? – Maltysen Jul 16 '15 at 12:30
• It would be useful if, in addition to showing what the puzzle looks like, you explained what the puzzle is. – Peter Taylor Jul 16 '15 at 20:18
• But if all don't have to be possible what's stopping me from doing print "IIIIIIIIIIIIIIII"? – Maltysen Jul 17 '15 at 2:13
• Fine but that's not what I meant, what about random_choose("I"*16, "Other hardcoded puzzle that I cant think of at the moment") – Maltysen Jul 17 '15 at 8:03