Gareth McCaughan said:
Yes. In particular, the *very* short solutions all (1) used
assignments within the program as input (though they didn't
count those assignments as part of the code),
No, at least one short solution did count those assignments (3 lines
of assignments out of 6 total lines of code).
You could replace those 3 lines by 1 line to read the contents of a file,
1 line to parse it and to call the algorithm, 1 line to calculate the
missing part of the input definition, and 1 line to print the result.
Maybe an additional line to get the filename from the commandline arguments.
So instead of 3, you have 4-5 lines. I didn't bother, because then you have
to edit 2 files instead of 1 for testing.
(2) used numbers to represent points, which enables various minor
algorithmic simplifications.
Nope. Anything that's comparable will do for the simple solution,
and with two additional lines, you can use anything that only admits equality.
If you just want the number of solutions, and not the solutions themselves
without "duplicates" by permutation, then you can do even without that
(just divide the length of the list of solutions by 6).
BTW, one more important difference is that some algorithms just counted,
while some actually computed all solutions. Some algorithms restricted
themselves to two "fans" of lines, while some allowed an arbitrary
geometry. And so on, and so on.
- Dirk