diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-08-14 13:32:19 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-08-14 13:32:19 +0200 |
| commit | c835bf15da3ce39b856222d352c800f6ebd51acf (patch) | |
| tree | 22f44fb6e766d9758a72182cef1dca7131e7a3a7 /python/examples/solve.py | |
| parent | 325778cb5f4b169ef7e197e179cfb889808d10c2 (diff) | |
| download | nissy-core-c835bf15da3ce39b856222d352c800f6ebd51acf.tar.gz nissy-core-c835bf15da3ce39b856222d352c800f6ebd51acf.zip | |
Added attempt to make pause / resume work with python module
Diffstat (limited to 'python/examples/solve.py')
| -rw-r--r-- | python/examples/solve.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/python/examples/solve.py b/python/examples/solve.py index 75e7914..c2c992b 100644 --- a/python/examples/solve.py +++ b/python/examples/solve.py | |||
| @@ -3,12 +3,10 @@ | |||
| 3 | # Run "./build.sh python", then run this from either the top-level directory | 3 | # Run "./build.sh python", then run this from either the top-level directory |
| 4 | # of the nissy-core repo or from the python subdirectory. | 4 | # of the nissy-core repo or from the python subdirectory. |
| 5 | 5 | ||
| 6 | # Append the directories to the python path so we can load the module | 6 | # Append the directories to the python path and import |
| 7 | import sys, os | 7 | import sys, os |
| 8 | sys.path.append(os.getcwd()) | 8 | sys.path.append(os.getcwd()) |
| 9 | sys.path.append(os.getcwd() + os.path.sep + "python") | 9 | sys.path.append(os.getcwd() + os.path.sep + "python") |
| 10 | |||
| 11 | # Import with a nicer name | ||
| 12 | import nissy | 10 | import nissy |
| 13 | 11 | ||
| 14 | # Choose the solver you prefer | 12 | # Choose the solver you prefer |
| @@ -26,7 +24,7 @@ else: | |||
| 26 | cube = nissy.applymoves(nissy.solved_cube, "U F R2"); | 24 | cube = nissy.applymoves(nissy.solved_cube, "U F R2"); |
| 27 | 25 | ||
| 28 | # Solve! | 26 | # Solve! |
| 29 | solutions = nissy.solve(cube, solver, nissy.nissflag_normal, 0, 9, 3, 20, 4, data) | 27 | solutions = nissy.solve(cube, solver, nissy.nissflag_normal, 0, 9, 3, 20, 4, data, None) |
| 30 | 28 | ||
| 31 | # Print the solutions, one per line | 29 | # Print the solutions, one per line |
| 32 | print("Found ", len(solutions), " solutions:") | 30 | print("Found ", len(solutions), " solutions:") |
