Algorithm to generate create a list of clues for puzzle
I finished writing this algorithm. Unfortunately, it runs so slow that I have no idea if it works. The gneral idea is:
Add clue to list
Determine if clue list is ambiguous (using |checkClueList()| )
If ambiguous, go to 1. Otherwise return list
I am currently trying to see if there is a bug causing the long running time, or if the algorithm just takes to long. If it is the latter, I have a few ideas to try to optimize it.
All relevant code is located in testing/LCinterface.js and testing/clues.js
Code:
https://github.com/gwsd2015/LogiClass/blob/master/testing/LCinterface.js : Contains functions pertaining to the clue-generation algorithm and functions that serve as interfaces for the datastructures
https://github.com/gwsd2015/LogiClass/blob/master/testing/datastructs.js : Contains data structures for the puzzle and functions for using them
https://github.com/gwsd2015/LogiClass/blob/master/testing/clues.js : Contains all clue algorithms I have written so far.
https://github.com/gwsd2015/LogiClass/blob/master/testing/error.js : I use this to systematically log error messages.
https://github.com/gwsd2015/LogiClass/blob/master/testing/main.js : Test file
https://github.com/gwsd2015/LogiClass/blob/master/testing/print.js : I use this to print some of the data structures for testing purposes
https://github.com/gwsd2015/LogiClass/blob/master/testing/testing.html : Used for testing
https://github.com/gwsd2015/LogiClass/blob/master/testing/unitTests.html : Used for testing
https://github.com/gwsd2015/LogiClass/blob/master/testing/unitTests.js : Used for testing
@twood02 @cctoombs
Algorithm to generate create a list of clues for puzzle
I finished writing this algorithm. Unfortunately, it runs so slow that I have no idea if it works. The gneral idea is:
I am currently trying to see if there is a bug causing the long running time, or if the algorithm just takes to long. If it is the latter, I have a few ideas to try to optimize it.
All relevant code is located in testing/LCinterface.js and testing/clues.js
Code: