Menu

#8 Text output of puzzle solutions

open
nobody
None
5
2009-04-30
2009-04-30
George Bell
No

Currently, it is my understanding that puzzle solutions can be viewed through the GUI, or exported as graphics. However, there is no way to export a text file with the puzzle pieces used by each solution. I would really like the have this capability.

For example, consider polyomino packing problems. One thing I like to do is include a vast number of possible pieces, and include each piece 0 or 1 times (this min/max flexibility is fantastic, by the way). Often this produces several thousand solutions, and I would like to know which solutions use a unique set of pieces. It is possible to determine this in the GUI by sorting by pieces and then scrolling through the solutions. When there are several thousand solutions, this becomes tedious. There are many more solution properties that might be interesting besides this. For example, given two different puzzles, I would like to know which have unique solutions using the same set of pieces. Or which use a completely different set of pieces.

A simple way to make this possible is to add a simple text text dump of a puzzle solution. At a bare minimum this could just be one line for each set of puzzle pieces that are used in each solution. If there were 3000 solutions to a puzzle this file would be 3000 lines long. One could then read this into some other program to determine uniqueness, cross reference with other solutions, etc.

From downloading the source, I understand that before the GUI was added there was some sort of text interface, but this was removed for lack of interest. Does this text interface allow for exporting of puzzle solutions as text files?

Discussion

  • Andreas Röver

    Andreas Röver - 2009-04-30

    The console application is still available, it is just not included in the windows binary for lack of usage. Up to now not one person complained about the missing program ... So I think all in all it was the right solution.

    I see several ways for you:

    - You could compile the program. I don't know if you have the energy to do that
    - You could use the saved puzzle file. It does contain that list of pieces for each solution. All you have to do is decompress it. The puzzle file is a gzip compressed xml file. Nearly every multi archive packer should be able to decompress it. From there on you could go on on your own.
    - I could prepare the command line program for you
    - I'm not really fond of a text export from the GUI because that would create a lot of ideas what and how to export things....
    - Best for you would be to write a program on your own that uses the BurrTools library and read the puzzle file(s) and does the filtering you want to have

     
  • George Bell

    George Bell - 2009-04-30

    Andreas,

    Thanks for your quick response! BurrTools is awesome!

    I already tried building it using cygwin and got bogged down in installing the libraries. But I may keep trying!

    Your comment on using the saved puzzle file is just what I needed to know. I just tried uncompressing a file and it worked! It looks like all the info I need is right there. I should be able to write a quick python program to extract all the info I need. Thanks! Maybe I can even use some python XML tool to read it in ...

     

Log in to post a comment.