Skip to content

gui: "Iterate" over solver solutions

Antoine Belvire requested to merge feature/gui_iterate_solutions into master

Context

This MR allows to generate several fills for a grid.

It is a follow-up of #1 (closed), which introduced the capability in croiseur and modified croiseur-cli to use it, but not croiseur-gui.

Just a recall of what was implemented in #1 (closed): It is not a real iteration, Croiseur actually shuffles dictionaries and calls solver to perform a new search. It is not very efficient but good enough to return different solutions.

To do a real iteration, one would need to keep a stateful solver object that allows to continue search after having found a solution, which would require a rework of the solver SPI (among other things).

Croiseur: Iterate solutions

What has changed?

Main Changes

gui-view-model

  • Separate box content filled by user and box content filled by solver: Solver content is an indication to the user, it is not used when trying to solve again while user content is.

gui-view

  • Display content filled by solver as prompt text.

gui-controller

  • Create source of randomness and pass it to Croiseur solver service to generate new solutions.

Side Effects

gui-view-model, gui-view, gui

  • Add a menu item in 'Clear Grid' menu to clear letters filled by solver.
Edited by Antoine Belvire

Merge request reports