PIsaacson wrote:Everyone keeps thinking within the SE box and, for some reason that I have yet to fathom, fearing the use of floating point doubles for something as mathematically simple as a sudoku scoring system. 16 digits of significance is plenty for this. Double arithmetic is plenty fast for this. Rounding and comparison algorithms are plentiful if even needed for this. I have a default calculation for each method based on the sudoku.ini configuration file base score plus code that approximates the SE length calculations. That's already in place and uses type float, so even 7 digits of significance suffices. All I intend is to provide a means to overload these default SE scoring algorithms with a user specified equation PLUS change it to use doubles with 16 significant digits of precision.
Your comments on output are intriguing to me. I already have functions that parse a format-like string similar to the serate --format param, but with additional formatting options such that you could specify something like %8.1r which converts to %8.1f or %81.81g which converts to %81.81s. There are several standard parts to my step display: step no, score, affected cell (RnCn), assignment or elimination symbol "<=" and "<>", digit(s) assigned/removed, string defining the pattern/chain. If you merely want to re-arrange the order with possible decoration, that would be relatively easy using something similar to the --format parsing. But, if the intent is to override the string defining the pattern/chain, that's something relatively difficult. I have a function somewhere that takes my internal chain stack and prints it either in NL, Eureka, AIC or nrczt chain formats. If that's all you need, then it would be easy enough to add that function and a runtime param to specify the preferred output formatting to use. If you're talking about something else, then I need to understand better what you mean by "most users would like to customize something to fit their jargon."
Paul
Fix rating to a double. Some may change it later if necessary. It is not significant at this stage.
What we want the puzzles to be sorted by? If the hardest move, represented as scalar, is insufficient, we need a vector. Implement a structure keeping the values of this vector in some convenient to you form. Implement operator "<". Later it can be changed. Let framework use this and only this operator for sorting the puzzles by difficulty. Keep in mind this is applicable to rating the moves within a solution path too - store "native" parameters of the specific move, and later remap to a scalar by tabular function instead by interpolating.
Predefine several levels of detailed output for one-line-per-move. Example is step number, method applied, difficulty rating, number of candidate eliminations, candidates left, list of eliminated candidates, list of solved cells. At runtime you could simply skip some of the fields according to the given level. Don't do it if you find difficulties, it is not much significant.
Implement internal representation of a "chain", and your favorite method for printing it. Others could implement their methods for printing, and call them at runtime just like you said.
Implement your favorite method for printing the whole information for a technique applied at a single move. Left alternative representations for others.
Implement simple queries like
- rate and print one-line-per-move info using details level ...;
- print steps from s1 to s2 using details level ...;
- rate puzzle list and sort it by rating, printing one line per puzzle.
Such technique allows by several executions of the tool to obtain the information you need for a specific step sequence, not scanning megabytes of heterogeneous dump. No interpreter needed.
Some will be interested in implementation of pure computational techniques like systematic guessing, eliminations by template, etc. Leave room such methods to have their place in the general rating mechanism - by additional coding and recompiling, not at runtime.
My final suggestion is to read the forum, but ignore the stuff you don't like to deal with, including mine posts. The community needs of far not perfect, but alive tool for rating.
Cheers,
MD