I’m developing a Sudoku solver using “human” methods.
I have a list of strategies in a lib/strategies directory and they all work the same, that’s to say like this StrategyName.new(sudoku).apply
How do I automatically apply all the strategies in the directory in the order I choose ? I can make each strategy give an ID to return its position in the strategy list for instance, or register them all in the right order in the solver class. But how do I list them all and apply them ? (autoload is on)
Thank you in advance !
Assuming your files follow the typical typical naming convention:
Assuming each strategy has a
#prioritymethod.