diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-04-17 10:50:57 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-04-17 14:36:27 +0200 |
| commit | 0ece4b72db22139db51e8f5f37c25f24c84f3e43 (patch) | |
| tree | fa9d0f5ec4124b2e51194ec6dc888e037b9da7e2 /python/nissy_module.c | |
| parent | 785f2859e336db49095a8443be8d204ba0989925 (diff) | |
| download | nissy-core-0ece4b72db22139db51e8f5f37c25f24c84f3e43.tar.gz nissy-core-0ece4b72db22139db51e8f5f37c25f24c84f3e43.zip | |
Small rework of optimal vs maxsols
I wanted to make the "optimal" and "maxsolutions" options mutually
exclusive, but in the end I decided there is value in keeping both
(e.g. for specifying a limit to the number of solutions when asking
for "all" optimal").
Now optimal cannot be negative anymore, for the same reason of maxsolutions.
The interface user (shell, UI) will have to take care of handling this
in a way that makes sense for the user. Usually this means setting
the maximum number of solutions to UINT_MAX (or a similar very high
number) when the user wants "all optimal".
Diffstat (limited to '')
| -rw-r--r-- | python/nissy_module.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/python/nissy_module.c b/python/nissy_module.c index e92cfd9..46570dc 100644 --- a/python/nissy_module.c +++ b/python/nissy_module.c | |||
| @@ -324,8 +324,7 @@ PyDoc_STRVAR(solve_doc, | |||
| 324 | " - minmoves: the minimum number of moves to use\n" | 324 | " - minmoves: the minimum number of moves to use\n" |
| 325 | " - maxmoves: the maximum number of moves to use\n" | 325 | " - maxmoves: the maximum number of moves to use\n" |
| 326 | " - maxsolution: the maximum number of solutions to return\n" | 326 | " - maxsolution: the maximum number of solutions to return\n" |
| 327 | " - optimal: the largest number of moves from the shortest solution" | 327 | " - optimal: the largest number of moves from the shortest solution\n" |
| 328 | "(set to -1 to ignore)\n" | ||
| 329 | " - threads: the number of threads to use (0 for default)\n" | 328 | " - threads: the number of threads to use (0 for default)\n" |
| 330 | " - data: a bytearray containing the data for the solver\n" | 329 | " - data: a bytearray containing the data for the solver\n" |
| 331 | "\n" | 330 | "\n" |
| @@ -343,7 +342,7 @@ solve(PyObject *self, PyObject *args) | |||
| 343 | PyByteArrayObject *data; | 342 | PyByteArrayObject *data; |
| 344 | PyObject *list, *item; | 343 | PyObject *list, *item; |
| 345 | 344 | ||
| 346 | if (!PyArg_ParseTuple(args, "ssIIIIiiY", &cube, &solver, &nissflag, | 345 | if (!PyArg_ParseTuple(args, "ssIIIIIIY", &cube, &solver, &nissflag, |
| 347 | &minmoves, &maxmoves, &maxsolutions, &optimal, &threads, &data)) | 346 | &minmoves, &maxmoves, &maxsolutions, &optimal, &threads, &data)) |
| 348 | return NULL; | 347 | return NULL; |
| 349 | 348 | ||
