Perfect Clear Finder

Started by morningpee, February 28, 2014, 04:26:24 AM

Previous topic - Next topic

morningpee

Perfect Clear Finder
Version 1.0
Last updated 02-28-2014


Basic Overview

The purpose of this program is to simplify finding stacking solutions, including perfect clears, for a given sequence of pieces.  The program does not consider stacking solutions that require holds, soft drops, slides, or twists to complete.

The program is able to run as long as it needs, until it is finished computing solutions to the current problem.

How to Use

"Find solutions" button

Press this button to get solutions for the current problem.  Using the default settings and default piece sequence, it will find 60 solutions.  There is a limit of 300 solutions for any problem.  

Field

This is where solutions show up.  Its dimensions are 10 columns by 20 rows.  Click and drag the mouse to change what the field looks like before you search for solutions.

Reset field

Clears the field back to an empty field, and clears all solutions found so far.  Press this button to start all over again.

"Pieces:" text box

Type the pieces here that you want to use for the current problem.  For reference, 10 pieces can fit within 4 lines.    Valid letters are "I", "J", "L", "O", "S", "T", "Z" (for now, letter must be uppercase).  If there is an invalid letter in this box, the "Find solutions" button will do nothing and the status box will tell you so.

Status Box

This box shows the program's response to the user.

PC Height

A number between 1 and 20; default is 4.  No pieces will be allowed above this height (with the exception of "Minos Above PC Height"), effectively "packing" them this many lines.  To find the appropriate number of pieces for a particular height, multiply the height by 2.5.  Example: 4 lines * 2.5 pieces per line  = 10 pieces.

Minos Above PC Height

A number between 0 and 10; default is 0.  A mino is a single square on the field, and 4 minos comprise each piece.  If you have drawn a shape that does not allow for solutions with no empty space within the PC height, and an imperfect solution is acceptable, consider allowing some minos above the PC height.

Solution Type

This determines which kind of solution will be acceptable and included in the list of solutions.  As a note, all solution types assume pieces will be hard-dropped.  Solutions that require holds, soft dropping, sliding, or twisting are not considered.

• "Whole pieces" solution type
1.9 seconds for the default problem on my weak computer

This is the strictest type, and finds the fewest solutions.  For this reason, it is also the fastest.  It does not consider line clears when computing solutions.  So, if you are only interested in "perfect clear Tetrises", where an I piece is used to complete the perfect clear, this is a good solution type.

• "Allow line clears" solution type
2.6 seconds for the default problem on my weak computer

This type finds all "whole pieces" solutions, and additionally finds solutions that require line clears.  It runs nearly as fast as the "whole pieces" solution type.

An example of a solution that requires a line clear is one where a T and a J complete the perfect clear, and occupy 4 rows and 2 columns.  In this example, the T is placed first, followed by the J, but there is only room for the J if placing the T results in a line clear.

Here is a fumen of such an example

• "Allow caves" solution type
31 minutes and 18 seconds for the default problem on my weak computer
4 minutes and 13 seconds if you leave the "Limit to 1 solution" checkbox checked.

This type finds all solutions that can be made by hard dropping pieces, and allows line clears.  It also allows there to be space underneath pieces that have been dropped, which "whole pieces" and "allow line clears" does not allow.  For this reason, it is much about 677 times as slow as the "whole pieces" solution type.  It also finds far more solutions than either other solution type.

Because it is so slow, I recommend you leave the "Limit to 1 solution" checkbox checked when using this option, unless you are prepared to wait awhile for the solutions.

An example of an "allow caves" solution

"Limit to 1 solution" checkbox

If you check this box, the program will stop searching after finding only 1 solution.  This option is useful if you are not interested in a particular solution but still want to know if a solution exists.  The box is checked by default for the "Allow caves" solution type.

Download for Mac OS X

Internet and Windows version release dates TBD.

I'll post examples of cool stuff you can do with this tomorrow.

StS

Waiting impatiently for Windows version. But wow, it's sounding great!
Sandal that Stinks

Current 40L (Nullpo): 35.32s

MuchoExito

This sounds great! Nice work! Need to wait for that windows release  .-.

Aaron

#3
Quote from: morningpeeWindows version release dates TBD.
Quote from: StSWaiting impatiently for Windows version. But wow, it's sounding great!
Quote from: MuchoExitoThis sounds great! Nice work! Need to wait for that windows release  .-.
( ͡° ͜ʖ ͡°)



[div align=\\\"center\\\"]
Quote from: AlexandraI don't really know much about hot dogs but I do know Aaron is the greatest moderator ever.
[/div]

Aaron

#4
I really like the icon. It looks like a kindergartener drew it, which fits the current state of Hard Drop to a T.
[div align=\\\"center\\\"]
Quote from: AlexandraI don't really know much about hot dogs but I do know Aaron is the greatest moderator ever.
[/div]

morningpee

Quote from: Aaron
I really like the icon. It looks like a kindergartener drew it, which fits the current state of Hard Drop to a T.


I was going for a crappy ripoff of the Nullpo icon, but I didn't have the time to make the circle.  And a proper color scheme is out of the question.

myndzi

Someone find that suspected-impossible sequence from the one thread and put it through this thing...

Paul676

Sounds great - will there be updates so that it does consider hold/twists/soft drops? Because that's the main thing with tough PCs, they often need them!
               Tetris Belts!

KILLJEFFREY

#8
Can't wait to get home and try it!
[div align=\\\"center\\\"]Line Race Personal Best, 47:48[/div]

officegunner

still.waiting.for,windows.rekease.


morningpee

Quote from: myndzi
Someone find that suspected-impossible sequence from the one thread and put it through this thing...

All hail caffeine and his solution for computing whether the suspected-impossible sequence is solvable!

http://harddrop.com/forums/index.php?showtopic=7565

His way of solving is superior to this. As of this post, my post cannot handle holds. The closest thing to his "deep drop" solver is my PC finder's "allow caves" mode. That mode is very slow in JavaScript, I have not tried it in OS X for awhile, but it definitely took more than 7,704,684,762 searches to figure out the info that caffeine got! Since my PC finder does not account for holds, it should be no surprise that it found no solutions when you input the suspected-impossible sequence.

Good job again

Alexsweden

I had not seen this before! I love it when people do things like this

Too bad its not available on PC though, given the nature of what its trying to do.. (get it? its doing PCs but cannot run on PC)

Also

Quote from: Aaron
I really like the icon. It looks like a kindergartener drew it, which fits the current state of Hard Drop to a T.

we tesla now

I will walk myself out