I was looking online to see if there is a standard way of representing Futoshiki puzzles in an ASCII file. So far, I found nothing. I note that some puzzles have upward and downward pointing ‘arrows’ connecting cells in a vertical manner, so one semi-obvious file format would be to use > < ^ and V (letter V) to represent the constraints, spaces for blank cells, and any other character to fill in any remaining spots not occupied by a number, relationship, or space. To make it more readable/editable for a human, we could begin with a basic empty grid composed of | + - characters, so for a 5x5 Futoshiki, something like this:
+-+-+-+-+-+
| | | | | |
+-+-+-+-+-+
| | | | | |
+-+-+-+-+-+
| | | | | |
+-+-+-+-+-+
| | | | | |
+-+-+-+-+-+
| | | | | |
+-+-+-+-+-+
… and then fill in any clue numbers in some of the spaces, and substitute the relationships in place of some of the existing ‘grid lines’, like this:
+-+-+-+-+-+
| |3| | | |
+-+-+-+-+-+
| < | | | |
+V+-+-+-+-+
| | | | > |
+-+-+-+-+-+
| | | <2| |
+V+-+-+-+-+
| > | < > |
+-+-+-+-+-+
The computer wouldn’t care about the + - and | characters, so you could use any non-relationship characters, though that would likely make the files less readable for a human. There’s no need for the top and bottom lines of each puzzle, nor the left and right columns, so those could be omitted to save space, though the puzzles might not then look as nice to a human.
No need to specify the size of the puzzles - the computer can infer that by the lengths of the lines.
It would be possible to have a big ASCII file, filled with lots of puzzles of various sizes, and the computer solver would then churn its way through the file, spitting out solutions, reports of unsolvable or badly formed puzzles, and the times taken to solve each one.
Of course, the file could also just contain a single puzzle, if that’s all you want to solve.
If anyone can suggest a less clunky format for the puzzle files, maybe an existing one that I’ve not found, that would be a good starting point for writing solvers - and it would make it easy for us to test different solvers on the same input files, to compare their solving times.