diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-08-12 15:20:16 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-08-12 15:20:16 +0200 |
| commit | 80a412f31c18a2fdf1d56cf9ec817a1d1819de82 (patch) | |
| tree | cbfc70719e949d609c6f4936901db06b9bd4400f /python/examples | |
| parent | a82527e00fd535d0740deb45e39d041863116404 (diff) | |
| download | nissy-core-80a412f31c18a2fdf1d56cf9ec817a1d1819de82.tar.gz nissy-core-80a412f31c18a2fdf1d56cf9ec817a1d1819de82.zip | |
Small improvemen to python example
Diffstat (limited to 'python/examples')
| -rw-r--r-- | python/examples/solve.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/python/examples/solve.py b/python/examples/solve.py index d77dd74..725c704 100644 --- a/python/examples/solve.py +++ b/python/examples/solve.py | |||
| @@ -14,11 +14,13 @@ import nissy | |||
| 14 | # Choose the solver you prefer | 14 | # Choose the solver you prefer |
| 15 | solver = "h48h0k4" | 15 | solver = "h48h0k4" |
| 16 | 16 | ||
| 17 | # Load the pruning table from file | 17 | # Load the pruning table from file, generate it if needed |
| 18 | data = bytearray(open("tables/" + solver, "rb").read()) | 18 | datapath = "tables" + os.path.sep + solver |
| 19 | 19 | if os.path.exists(datapath): | |
| 20 | # If you have not generated the table yet, you can do so: | 20 | data = bytearray(open(datapath, "rb").read()) |
| 21 | # data = nissy.gendata("h48h0k4") | 21 | else: |
| 22 | data = nissy.gendata("h48h0k4") | ||
| 23 | print("Generated data will NOT be persisted") | ||
| 22 | 24 | ||
| 23 | # Get a scrambled cube | 25 | # Get a scrambled cube |
| 24 | cube = nissy.applymoves(nissy.solved_cube, "U F R2"); | 26 | cube = nissy.applymoves(nissy.solved_cube, "U F R2"); |
