1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00
Commit graph

1072 commits

Author SHA1 Message Date
Juhani Numminen
1c79d5437e Refactor initCardsets
Make variable names descriptive.

Don't check for duplicate or empty strings in result of getSearchDirs() because
that is not necessary. Document those properties in a comment in resource.py.

Wrap try...except more closely around expressions where we want to catch.
2020-10-15 12:30:36 +03:00
Juhani Numminen
24ccdf634b macOS: use "PySolFC Help" menuitem provided by tk
The details are explained in this tutorial
https://tkdocs.com/tutorial/menus.html

For this to work, init() must destroy the tkinter.Tk instance it creates
so that was uncommented.
2020-10-14 14:59:38 +03:00
Juhani Numminen
d3faa78e75 Prune pysollib.macosx; it no longer had any effect 2020-10-12 23:35:15 +03:00
Juhani Numminen
278b3261d9 Optimize cardsetparser
Apply the EAFP principle:
Regex matching was just doing extra the work because int() will check that
its argument is suitable in any case.

EAFP as in https://stackoverflow.com/questions/11360858/what-is-the-eafp-principle-in-python
2020-10-11 16:27:43 +03:00
Shlomi Fish
d145642a9b Rename variables to make them more descriptive.
We used "lines_list" instead of "line" in singular. "list" is
the ADT ( https://en.wikipedia.org/wiki/Abstract_data_type )
rather than its python class.
2020-10-11 13:02:01 +03:00
Juhani Numminen
12601364dc Invoke init_tile() only when tile is used 2020-10-10 21:23:35 +03:00
Juhani Numminen
0be465dea1 Add error message for a missing card back (#185) 2020-10-10 21:22:58 +03:00
Shlomi Fish
95a0d7d007 refactor/modernize the calls to open()
use "with", flags
2020-10-06 18:43:15 +03:00
Juhani Numminen
bf9ce90a5b Refactor cardset config.txt parser to a new module 2020-10-06 14:35:28 +03:00
Shlomi Fish
39d59547af flake8 compliance 2020-09-07 11:20:53 +03:00
Shlomi Fish
b24da7cc92 Gracefully handle pypi pysol_cards dependency
See:
https://sourceforge.net/p/pysolfc/discussion/503708/thread/208461caee/

Thanks to Fred.
2020-08-27 12:04:42 +03:00
Shlomi Fish
e2c11a7ba0 fix flake8 + tidyall tests 2020-08-27 11:52:59 +03:00
Shlomi Fish
e9e19afc46 Use freecell-solver wo which fc-solve.
No need for the executable if freecell_solver.py exists and
can be instantiated.
2020-06-24 16:59:40 +03:00
Shlomi Fish
bb8785e76b prepare for the new release 2020-06-22 13:28:22 +03:00
Shlomi Fish
38def5a0e7 optimize by using .recycle() 2020-06-20 13:45:48 +03:00
Shlomi Fish
18a460a1e7 implement black_hole_solver lib. 2020-06-19 16:19:12 +03:00
Shlomi Fish
7eb29a216f refactoring: del some unhelpful comments 2020-06-18 12:45:38 +03:00
Shlomi Fish
b518678d8d extract a method which delegates 2020-06-18 12:07:35 +03:00
Shlomi Fish
41c2633fcd update the solver iter and states counts. 2020-06-18 11:55:41 +03:00
Shlomi Fish
3de9955879 try2fix flake 8 tests [travis/etc.] 2020-06-17 20:53:11 +03:00
Shlomi Fish
db348ee91b trap import error better [fix] 2020-06-17 20:15:39 +03:00
Shlomi Fish
fcc55dfe56 refactoring: avoid underused vars 2020-06-17 20:11:54 +03:00
Shlomi Fish
697f15c9df convert to .format() 2020-06-17 14:22:39 +03:00
Shlomi Fish
d9efba4456 Refactoring / code cleanup.
See:

* https://en.wikipedia.org/wiki/Code_refactoring

* https://www.refactoring.com/

* https://www.joelonsoftware.com/2002/01/23/rub-a-dub-dub/

Some small optimisations may have slipped in as well.
2020-06-17 13:48:48 +03:00
Shlomi Fish
14d4c0c509 rename 2020-06-17 13:17:30 +03:00
Shlomi Fish
fa85fbdadd fix simple simon solver 2020-06-17 13:07:48 +03:00
Shlomi Fish
e49c3a153f rename and persist across invocations 2020-06-17 12:42:16 +03:00
Shlomi Fish
1ee67d9ca8 add not(use_lib) to fix subsequent solving 2020-06-17 11:50:12 +03:00
Shlomi Fish
c96d25d628 disable a debug print() call 2020-06-17 11:43:06 +03:00
Shlomi Fish
556ceed9a6 stringify "args" list 2020-06-17 10:21:02 +03:00
Shlomi Fish
faf8341c5e fix cmd line args 2020-06-16 22:57:16 +03:00
Shlomi Fish
f998b53d79 fix ncards 2020-06-16 22:35:59 +03:00
Shlomi Fish
fee9f6e20e WiP support for using solvers' DLLs 2020-06-16 22:29:42 +03:00
Shlomi Fish
d04601ad1c add a test for ScorpionTail_RowStack.
A similar bug was fixed in Scorpion_RowStack.
2020-06-16 10:34:05 +03:00
Shlomi Fish
730ecf775b Fix for ScorpionTail in python3.
It is hacky and there may be many similar bugs.

See https://github.com/shlomif/PySolFC/issues/164 .

It also needs tests.
2020-06-16 10:34:05 +03:00
Shlomi Fish
8e4ed1e157 Tentative fix for Scorpion Tail/etc. play.
See https://github.com/shlomif/PySolFC/issues/164

Thanks to @Arcorann. Needs tests.
2020-06-16 10:34:05 +03:00
Shlomi Fish
408a8fbb08 fix flake8 tests 2020-06-12 07:07:31 +03:00
Shlomi Fish
478fa82e86 fixed already 2020-05-29 15:31:40 +03:00
Shlomi Fish
7e6cf5694b remove unused and bad "tests" - see tests/ 2020-05-29 15:30:38 +03:00
Shlomi Fish
3653a51176 fix in pysol-cards.py now 2020-05-27 09:17:40 +03:00
Shlomi Fish
a219bdb29c temp fix for reset() in pysolfc/mtrandom deals.
See: https://github.com/shlomif/PySolFC/issues/163 . Thanks
to @RobertAJMarshall .
2020-05-27 09:10:25 +03:00
Robert Marshall
e43dcb207c Avoid an unexpected pause state around stats 2020-05-26 18:58:46 +01:00
Shlomi Fish
2437c702fd extract more code to pysol_cards 2020-05-26 18:56:14 +03:00
Shlomi Fish
467a0f14e0 remove an old comment 2020-05-25 15:06:39 +03:00
Shlomi Fish
88cdccea5b extract more code to pysol_cards 2020-05-25 14:51:49 +03:00
Shlomi Fish
7914c6e805 extract more code to pysol_cards 2020-05-25 14:50:45 +03:00
Shlomi Fish
3ef4b3c6dc extract more code to pysol_cards 2020-05-25 14:20:15 +03:00
Shlomi Fish
12cf1e507f Rename variable/s to make them more descriptive. 2020-05-25 14:06:08 +03:00
Shlomi Fish
b311ff83fd extract more code to pysol_cards 2020-05-25 13:47:16 +03:00
Shlomi Fish
a8fd45e2f8 extract more code to pysol_cards 2020-05-25 13:42:02 +03:00