コード例 #1
0
ファイル: e02_csp.py プロジェクト: schroeji/Projekt-Euler
def main():
    """
    A main function. This might be useful for developing, if you don't
    want to run all tests all the time. Just write here what ever you
    want to develop your code. If you use pycharm you can run the unittests
    also by right-clicking them and then e.g. "Run 'Unittest test_sudoku_1'".
    """

    # first lets test with a already created csp:
    csp = create_map_csp()
    solution = backtracking(csp)
    print(solution)

    # and now with our own generated sudoku CSP
    sudokus = read_sudokus()
    csp = create_sudoku_csp(sudokus[5])
    t1 = time.time();
    solution, _ = minimum_remaining_values_with_degree(csp)
    print(time.time() - t1)
    print(sudoku_csp_to_array(solution))
コード例 #2
0
ファイル: test.py プロジェクト: schroeji/Projekt-Euler
 def setUp(self):
     self.csp = create_map_csp()