aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore65
-rw-r--r--.gitmodules3
-rw-r--r--Makefile12
-rw-r--r--centre.cpp178
-rw-r--r--metasol.cpp219
-rw-r--r--metasol.h19
-rw-r--r--solvitaire/.gitignore61
-rw-r--r--solvitaire/.idea/.name (renamed from .idea/.name)0
-rw-r--r--solvitaire/.idea/Solvitaire.iml (renamed from .idea/Solvitaire.iml)0
-rw-r--r--solvitaire/.idea/codeStyleSettings.xml (renamed from .idea/codeStyleSettings.xml)0
-rw-r--r--solvitaire/.idea/codeStyles/Project.xml (renamed from .idea/codeStyles/Project.xml)0
-rw-r--r--solvitaire/.idea/codeStyles/codeStyleConfig.xml (renamed from .idea/codeStyles/codeStyleConfig.xml)0
-rw-r--r--solvitaire/.idea/misc.xml (renamed from .idea/misc.xml)0
-rw-r--r--solvitaire/.idea/modules.xml (renamed from .idea/modules.xml)0
-rw-r--r--solvitaire/.idea/statistic.xml (renamed from .idea/statistic.xml)0
-rw-r--r--solvitaire/.idea/vcs.xml (renamed from .idea/vcs.xml)0
-rw-r--r--solvitaire/CMakeLists.txt (renamed from CMakeLists.txt)8
-rw-r--r--solvitaire/CMakeLists.txt.in (renamed from CMakeLists.txt.in)0
-rw-r--r--solvitaire/Dockerfile (renamed from Dockerfile)0
-rw-r--r--solvitaire/README.md (renamed from README.md)0
-rw-r--r--solvitaire/archive/README.md (renamed from archive/README.md)0
-rw-r--r--solvitaire/archive/build-notes.md (renamed from archive/build-notes.md)0
-rw-r--r--solvitaire/archive/canfield-check.py (renamed from archive/canfield-check.py)0
-rwxr-xr-xsolvitaire/archive/clean-build.sh (renamed from archive/clean-build.sh)0
-rw-r--r--solvitaire/archive/docs/DOER-document/main.tex (renamed from archive/docs/DOER-document/main.tex)0
-rw-r--r--solvitaire/archive/docs/DOER-document/references.bib (renamed from archive/docs/DOER-document/references.bib)0
-rw-r--r--solvitaire/archive/docs/project-tools.md (renamed from archive/docs/project-tools.md)0
-rw-r--r--solvitaire/archive/docs/supervisor-meetings/2017-09-12.md (renamed from archive/docs/supervisor-meetings/2017-09-12.md)0
-rw-r--r--solvitaire/archive/docs/supervisor-meetings/2017-09-19.md (renamed from archive/docs/supervisor-meetings/2017-09-19.md)0
-rw-r--r--solvitaire/archive/docs/supervisor-meetings/2017-09-25.md (renamed from archive/docs/supervisor-meetings/2017-09-25.md)0
-rw-r--r--solvitaire/archive/docs/supervisor-meetings/2017-10-03.md (renamed from archive/docs/supervisor-meetings/2017-10-03.md)0
-rw-r--r--solvitaire/archive/docs/supervisor-meetings/2017-10-12.md (renamed from archive/docs/supervisor-meetings/2017-10-12.md)0
-rw-r--r--solvitaire/archive/docs/supervisor-meetings/2017-10-17.md (renamed from archive/docs/supervisor-meetings/2017-10-17.md)0
-rw-r--r--solvitaire/archive/docs/supervisor-meetings/2017-10-24.md (renamed from archive/docs/supervisor-meetings/2017-10-24.md)0
-rw-r--r--solvitaire/archive/docs/supervisor-meetings/2017-10-31.md (renamed from archive/docs/supervisor-meetings/2017-10-31.md)0
-rw-r--r--solvitaire/archive/docs/supervisor-meetings/2017-11-07.md (renamed from archive/docs/supervisor-meetings/2017-11-07.md)0
-rw-r--r--solvitaire/archive/docs/supervisor-meetings/2017-11-14.md (renamed from archive/docs/supervisor-meetings/2017-11-14.md)0
-rw-r--r--solvitaire/archive/docs/supervisor-meetings/2017-11-28.md (renamed from archive/docs/supervisor-meetings/2017-11-28.md)0
-rw-r--r--solvitaire/archive/docs/supervisor-meetings/2018-02-01.md (renamed from archive/docs/supervisor-meetings/2018-02-01.md)0
-rw-r--r--solvitaire/archive/docs/supervisor-meetings/2018-02-08.md (renamed from archive/docs/supervisor-meetings/2018-02-08.md)0
-rwxr-xr-xsolvitaire/archive/generate-results-optimisations-off.sh (renamed from archive/generate-results-optimisations-off.sh)0
-rw-r--r--solvitaire/archive/optimisation-test.py (renamed from archive/optimisation-test.py)0
-rwxr-xr-xsolvitaire/archive/real-benchmark.sh (renamed from archive/real-benchmark.sh)0
-rwxr-xr-xsolvitaire/archive/repeat_deal.sh (renamed from archive/repeat_deal.sh)0
-rwxr-xr-xsolvitaire/build.sh (renamed from build.sh)0
-rwxr-xr-xsolvitaire/docker-install.sh (renamed from docker-install.sh)0
-rwxr-xr-xsolvitaire/enter-container.sh (renamed from enter-container.sh)0
-rwxr-xr-xsolvitaire/generate-results.sh (renamed from generate-results.sh)0
l---------solvitaire/headers1
-rw-r--r--solvitaire/lib/rapidjson/allocators.h (renamed from lib/rapidjson/allocators.h)0
-rw-r--r--solvitaire/lib/rapidjson/cursorstreamwrapper.h (renamed from lib/rapidjson/cursorstreamwrapper.h)0
-rw-r--r--solvitaire/lib/rapidjson/document.h (renamed from lib/rapidjson/document.h)0
-rw-r--r--solvitaire/lib/rapidjson/encodedstream.h (renamed from lib/rapidjson/encodedstream.h)0
-rw-r--r--solvitaire/lib/rapidjson/encodings.h (renamed from lib/rapidjson/encodings.h)0
-rw-r--r--solvitaire/lib/rapidjson/error/en.h (renamed from lib/rapidjson/error/en.h)0
-rw-r--r--solvitaire/lib/rapidjson/error/error.h (renamed from lib/rapidjson/error/error.h)0
-rw-r--r--solvitaire/lib/rapidjson/filereadstream.h (renamed from lib/rapidjson/filereadstream.h)0
-rw-r--r--solvitaire/lib/rapidjson/filewritestream.h (renamed from lib/rapidjson/filewritestream.h)0
-rw-r--r--solvitaire/lib/rapidjson/fwd.h (renamed from lib/rapidjson/fwd.h)0
-rw-r--r--solvitaire/lib/rapidjson/internal/biginteger.h (renamed from lib/rapidjson/internal/biginteger.h)0
-rw-r--r--solvitaire/lib/rapidjson/internal/diyfp.h (renamed from lib/rapidjson/internal/diyfp.h)0
-rw-r--r--solvitaire/lib/rapidjson/internal/dtoa.h (renamed from lib/rapidjson/internal/dtoa.h)0
-rw-r--r--solvitaire/lib/rapidjson/internal/ieee754.h (renamed from lib/rapidjson/internal/ieee754.h)0
-rw-r--r--solvitaire/lib/rapidjson/internal/itoa.h (renamed from lib/rapidjson/internal/itoa.h)0
-rw-r--r--solvitaire/lib/rapidjson/internal/meta.h (renamed from lib/rapidjson/internal/meta.h)0
-rw-r--r--solvitaire/lib/rapidjson/internal/pow10.h (renamed from lib/rapidjson/internal/pow10.h)0
-rw-r--r--solvitaire/lib/rapidjson/internal/regex.h (renamed from lib/rapidjson/internal/regex.h)0
-rw-r--r--solvitaire/lib/rapidjson/internal/stack.h (renamed from lib/rapidjson/internal/stack.h)0
-rw-r--r--solvitaire/lib/rapidjson/internal/strfunc.h (renamed from lib/rapidjson/internal/strfunc.h)0
-rw-r--r--solvitaire/lib/rapidjson/internal/strtod.h (renamed from lib/rapidjson/internal/strtod.h)0
-rw-r--r--solvitaire/lib/rapidjson/internal/swap.h (renamed from lib/rapidjson/internal/swap.h)0
-rw-r--r--solvitaire/lib/rapidjson/istreamwrapper.h (renamed from lib/rapidjson/istreamwrapper.h)0
-rw-r--r--solvitaire/lib/rapidjson/memorybuffer.h (renamed from lib/rapidjson/memorybuffer.h)0
-rw-r--r--solvitaire/lib/rapidjson/memorystream.h (renamed from lib/rapidjson/memorystream.h)0
-rw-r--r--solvitaire/lib/rapidjson/msinttypes/inttypes.h (renamed from lib/rapidjson/msinttypes/inttypes.h)0
-rw-r--r--solvitaire/lib/rapidjson/msinttypes/stdint.h (renamed from lib/rapidjson/msinttypes/stdint.h)0
-rw-r--r--solvitaire/lib/rapidjson/ostreamwrapper.h (renamed from lib/rapidjson/ostreamwrapper.h)0
-rw-r--r--solvitaire/lib/rapidjson/pointer.h (renamed from lib/rapidjson/pointer.h)0
-rw-r--r--solvitaire/lib/rapidjson/prettywriter.h (renamed from lib/rapidjson/prettywriter.h)0
-rw-r--r--solvitaire/lib/rapidjson/rapidjson.h (renamed from lib/rapidjson/rapidjson.h)0
-rw-r--r--solvitaire/lib/rapidjson/reader.h (renamed from lib/rapidjson/reader.h)0
-rw-r--r--solvitaire/lib/rapidjson/schema.h (renamed from lib/rapidjson/schema.h)0
-rw-r--r--solvitaire/lib/rapidjson/stream.h (renamed from lib/rapidjson/stream.h)0
-rw-r--r--solvitaire/lib/rapidjson/stringbuffer.h (renamed from lib/rapidjson/stringbuffer.h)0
-rw-r--r--solvitaire/lib/rapidjson/writer.h (renamed from lib/rapidjson/writer.h)0
l---------solvitaire/libsol.a1
-rw-r--r--solvitaire/resources/deal-presets/ImpossibleFreeCell11982.json (renamed from resources/deal-presets/ImpossibleFreeCell11982.json)0
-rw-r--r--solvitaire/resources/deal-presets/alinaSF100.json (renamed from resources/deal-presets/alinaSF100.json)0
-rw-r--r--solvitaire/resources/deal-presets/bg0.json (renamed from resources/deal-presets/bg0.json)0
-rw-r--r--solvitaire/resources/deal-presets/bg1.json (renamed from resources/deal-presets/bg1.json)0
-rw-r--r--solvitaire/resources/deal-presets/bg10.json (renamed from resources/deal-presets/bg10.json)0
-rw-r--r--solvitaire/resources/deal-presets/bg14.json (renamed from resources/deal-presets/bg14.json)0
-rw-r--r--solvitaire/resources/deal-presets/err_klondike.json (renamed from resources/deal-presets/err_klondike.json)0
-rw-r--r--solvitaire/resources/deal-presets/klondikeSM1.json (renamed from resources/deal-presets/klondikeSM1.json)0
-rw-r--r--solvitaire/resources/deal-presets/klondikeSM2.json (renamed from resources/deal-presets/klondikeSM2.json)0
-rw-r--r--solvitaire/resources/deal-presets/raglan-ipg.json (renamed from resources/deal-presets/raglan-ipg.json)0
-rw-r--r--solvitaire/resources/deal-presets/shootMeKlondikeConverter.py (renamed from resources/deal-presets/shootMeKlondikeConverter.py)0
-rw-r--r--solvitaire/resources/positional_games.json (renamed from resources/positional_games.json)0
-rwxr-xr-xsolvitaire/solvability.sh (renamed from solvability.sh)0
l---------solvitaire/solvitaire (renamed from solvitaire)0
l---------solvitaire/solvitaire-debug (renamed from solvitaire-debug)0
-rw-r--r--solvitaire/src/main/api.cpp24
-rw-r--r--solvitaire/src/main/api.h117
-rw-r--r--solvitaire/src/main/evaluation/benchmark.cpp (renamed from src/main/evaluation/benchmark.cpp)0
-rw-r--r--solvitaire/src/main/evaluation/benchmark.h (renamed from src/main/evaluation/benchmark.h)0
-rw-r--r--solvitaire/src/main/evaluation/binomial_ci.cpp (renamed from src/main/evaluation/binomial_ci.cpp)0
-rw-r--r--solvitaire/src/main/evaluation/binomial_ci.h (renamed from src/main/evaluation/binomial_ci.h)0
-rw-r--r--solvitaire/src/main/evaluation/solvability_calc.cpp (renamed from src/main/evaluation/solvability_calc.cpp)0
-rw-r--r--solvitaire/src/main/evaluation/solvability_calc.h (renamed from src/main/evaluation/solvability_calc.h)0
-rw-r--r--solvitaire/src/main/game/card.cpp (renamed from src/main/game/card.cpp)0
-rw-r--r--solvitaire/src/main/game/card.h (renamed from src/main/game/card.h)0
-rw-r--r--solvitaire/src/main/game/global_cache.cpp (renamed from src/main/game/global_cache.cpp)0
-rw-r--r--solvitaire/src/main/game/global_cache.h (renamed from src/main/game/global_cache.h)0
-rw-r--r--solvitaire/src/main/game/move.cpp (renamed from src/main/game/move.cpp)0
-rw-r--r--solvitaire/src/main/game/move.h (renamed from src/main/game/move.h)0
-rw-r--r--solvitaire/src/main/game/pile.cpp (renamed from src/main/game/pile.cpp)0
-rw-r--r--solvitaire/src/main/game/pile.h (renamed from src/main/game/pile.h)0
-rw-r--r--solvitaire/src/main/game/search-state/game_state.cpp (renamed from src/main/game/search-state/game_state.cpp)0
-rw-r--r--solvitaire/src/main/game/search-state/game_state.dominance_moves.cpp (renamed from src/main/game/search-state/game_state.dominance_moves.cpp)0
-rw-r--r--solvitaire/src/main/game/search-state/game_state.h (renamed from src/main/game/search-state/game_state.h)0
-rw-r--r--solvitaire/src/main/game/search-state/game_state.legal_moves.cpp (renamed from src/main/game/search-state/game_state.legal_moves.cpp)0
-rw-r--r--solvitaire/src/main/game/search-state/game_state.pile_order.cpp (renamed from src/main/game/search-state/game_state.pile_order.cpp)0
-rw-r--r--solvitaire/src/main/game/sol_rules.cpp (renamed from src/main/game/sol_rules.cpp)0
-rw-r--r--solvitaire/src/main/game/sol_rules.h (renamed from src/main/game/sol_rules.h)0
-rw-r--r--solvitaire/src/main/input-output/input/command_line_helper.cpp (renamed from src/main/input-output/input/command_line_helper.cpp)0
-rw-r--r--solvitaire/src/main/input-output/input/command_line_helper.h (renamed from src/main/input-output/input/command_line_helper.h)0
-rw-r--r--solvitaire/src/main/input-output/input/json-parsing/deal_parser.cpp (renamed from src/main/input-output/input/json-parsing/deal_parser.cpp)0
-rw-r--r--solvitaire/src/main/input-output/input/json-parsing/deal_parser.h (renamed from src/main/input-output/input/json-parsing/deal_parser.h)0
-rw-r--r--solvitaire/src/main/input-output/input/json-parsing/json_helper.cpp (renamed from src/main/input-output/input/json-parsing/json_helper.cpp)0
-rw-r--r--solvitaire/src/main/input-output/input/json-parsing/json_helper.h (renamed from src/main/input-output/input/json-parsing/json_helper.h)0
-rw-r--r--solvitaire/src/main/input-output/input/json-parsing/rules_parser.cpp (renamed from src/main/input-output/input/json-parsing/rules_parser.cpp)0
-rw-r--r--solvitaire/src/main/input-output/input/json-parsing/rules_parser.h (renamed from src/main/input-output/input/json-parsing/rules_parser.h)0
-rw-r--r--solvitaire/src/main/input-output/input/sol_preset_types.cpp (renamed from src/main/input-output/input/sol_preset_types.cpp)0
-rw-r--r--solvitaire/src/main/input-output/input/sol_preset_types.h (renamed from src/main/input-output/input/sol_preset_types.h)0
-rw-r--r--solvitaire/src/main/input-output/output/log_helper.h (renamed from src/main/input-output/output/log_helper.h)0
-rw-r--r--solvitaire/src/main/input-output/output/state_printer.cpp (renamed from src/main/input-output/output/state_printer.cpp)0
-rw-r--r--solvitaire/src/main/input-output/output/state_printer.h (renamed from src/main/input-output/output/state_printer.h)0
-rw-r--r--solvitaire/src/main/main.cpp (renamed from src/main/main.cpp)0
-rw-r--r--solvitaire/src/main/solver/solver.cpp (renamed from src/main/solver/solver.cpp)0
-rw-r--r--solvitaire/src/main/solver/solver.h (renamed from src/main/solver/solver.h)4
-rw-r--r--solvitaire/src/test/integration_tests/accordion_test.cpp (renamed from src/test/integration_tests/accordion_test.cpp)0
-rw-r--r--solvitaire/src/test/integration_tests/alpha_star_test.cpp (renamed from src/test/integration_tests/alpha_star_test.cpp)0
-rw-r--r--solvitaire/src/test/integration_tests/bakers_dozen_test.cpp (renamed from src/test/integration_tests/bakers_dozen_test.cpp)0
-rw-r--r--solvitaire/src/test/integration_tests/black_hole_test.cpp (renamed from src/test/integration_tests/black_hole_test.cpp)0
-rw-r--r--solvitaire/src/test/integration_tests/canfield_test.cpp (renamed from src/test/integration_tests/canfield_test.cpp)0
-rw-r--r--solvitaire/src/test/integration_tests/flower_garden_test.cpp (renamed from src/test/integration_tests/flower_garden_test.cpp)0
-rw-r--r--solvitaire/src/test/integration_tests/fortunes_favor_test.cpp (renamed from src/test/integration_tests/fortunes_favor_test.cpp)0
-rw-r--r--solvitaire/src/test/integration_tests/free_cell_test.cpp (renamed from src/test/integration_tests/free_cell_test.cpp)0
-rw-r--r--solvitaire/src/test/integration_tests/gaps_test.cpp (renamed from src/test/integration_tests/gaps_test.cpp)0
-rw-r--r--solvitaire/src/test/integration_tests/klondike_test.cpp (renamed from src/test/integration_tests/klondike_test.cpp)0
-rw-r--r--solvitaire/src/test/integration_tests/somerset_test.cpp (renamed from src/test/integration_tests/somerset_test.cpp)0
-rw-r--r--solvitaire/src/test/integration_tests/spanish_patience_test.cpp (renamed from src/test/integration_tests/spanish_patience_test.cpp)0
-rw-r--r--solvitaire/src/test/integration_tests/spider_test.cpp (renamed from src/test/integration_tests/spider_test.cpp)0
-rw-r--r--solvitaire/src/test/resources/accordion/ComplexSolvable.json (renamed from src/test/resources/accordion/ComplexSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/accordion/ComplexUnsolvable.json (renamed from src/test/resources/accordion/ComplexUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/accordion/SimpleSolvable.json (renamed from src/test/resources/accordion/SimpleSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/accordion/SimpleUnsolvable.json (renamed from src/test/resources/accordion/SimpleUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/alpha_star/ComplexSolvable.json (renamed from src/test/resources/alpha_star/ComplexSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/alpha_star/ComplexUnsolvable.json (renamed from src/test/resources/alpha_star/ComplexUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/alpha_star/SimpleSolvable.json (renamed from src/test/resources/alpha_star/SimpleSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/alpha_star/SimpleUnsolvable.json (renamed from src/test/resources/alpha_star/SimpleUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/bakers_dozen/ComplexSolvable.json (renamed from src/test/resources/bakers_dozen/ComplexSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/bakers_dozen/ComplexUnsolvable.json (renamed from src/test/resources/bakers_dozen/ComplexUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/bakers_dozen/SimpleSolvable.json (renamed from src/test/resources/bakers_dozen/SimpleSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/bakers_dozen/SimpleUnsolvable.json (renamed from src/test/resources/bakers_dozen/SimpleUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/black_hole/ComplexSolvable.json (renamed from src/test/resources/black_hole/ComplexSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/black_hole/ComplexUnsolvable.json (renamed from src/test/resources/black_hole/ComplexUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/black_hole/SimpleSolvable.json (renamed from src/test/resources/black_hole/SimpleSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/black_hole/SimpleUnsolvable.json (renamed from src/test/resources/black_hole/SimpleUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/canfield/ComplexSolvable.json (renamed from src/test/resources/canfield/ComplexSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/canfield/ComplexUnsolvable.json (renamed from src/test/resources/canfield/ComplexUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/canfield/SimpleSolvable.json (renamed from src/test/resources/canfield/SimpleSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/canfield/SimpleUnsolvable.json (renamed from src/test/resources/canfield/SimpleUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/flower_garden/ComplexSolvable.json (renamed from src/test/resources/flower_garden/ComplexSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/flower_garden/ComplexUnsolvable.json (renamed from src/test/resources/flower_garden/ComplexUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/flower_garden/SimpleSolvable.json (renamed from src/test/resources/flower_garden/SimpleSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/flower_garden/SimpleUnsolvable.json (renamed from src/test/resources/flower_garden/SimpleUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/fortunes_favor/ComplexSolvable.json (renamed from src/test/resources/fortunes_favor/ComplexSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/fortunes_favor/ComplexUnsolvable.json (renamed from src/test/resources/fortunes_favor/ComplexUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/fortunes_favor/SimpleSolvable.json (renamed from src/test/resources/fortunes_favor/SimpleSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/fortunes_favor/SimpleUnsolvable.json (renamed from src/test/resources/fortunes_favor/SimpleUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/free_cell/ComplexSolvable.json (renamed from src/test/resources/free_cell/ComplexSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/free_cell/ComplexUnsolvable.json (renamed from src/test/resources/free_cell/ComplexUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/free_cell/SimpleSolvable.json (renamed from src/test/resources/free_cell/SimpleSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/free_cell/SimpleUnsolvable.json (renamed from src/test/resources/free_cell/SimpleUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/gaps/ComplexSolvable.json (renamed from src/test/resources/gaps/ComplexSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/gaps/ComplexUnsolvable.json (renamed from src/test/resources/gaps/ComplexUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/gaps/SimpleSolvable.json (renamed from src/test/resources/gaps/SimpleSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/gaps/SimpleUnsolvable.json (renamed from src/test/resources/gaps/SimpleUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/klondike/ComplexSolvable.json (renamed from src/test/resources/klondike/ComplexSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/klondike/ComplexUnsolvable.json (renamed from src/test/resources/klondike/ComplexUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/klondike/SimpleSolvable.json (renamed from src/test/resources/klondike/SimpleSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/klondike/SimpleUnsolvable.json (renamed from src/test/resources/klondike/SimpleUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/somerset/ComplexSolvable.json (renamed from src/test/resources/somerset/ComplexSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/somerset/ComplexUnsolvable.json (renamed from src/test/resources/somerset/ComplexUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/somerset/SimpleSolvable.json (renamed from src/test/resources/somerset/SimpleSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/somerset/SimpleUnsolvable.json (renamed from src/test/resources/somerset/SimpleUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/spanish_patience/ComplexSolvable.json (renamed from src/test/resources/spanish_patience/ComplexSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/spanish_patience/ComplexUnsolvable.json (renamed from src/test/resources/spanish_patience/ComplexUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/spanish_patience/SimpleSolvable.json (renamed from src/test/resources/spanish_patience/SimpleSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/spanish_patience/SimpleUnsolvable.json (renamed from src/test/resources/spanish_patience/SimpleUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/spider/ComplexSolvable.json (renamed from src/test/resources/spider/ComplexSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/spider/ComplexUnsolvable.json (renamed from src/test/resources/spider/ComplexUnsolvable.json)0
-rw-r--r--solvitaire/src/test/resources/spider/SimpleSolvable.json (renamed from src/test/resources/spider/SimpleSolvable.json)0
-rw-r--r--solvitaire/src/test/resources/spider/SimpleUnsolvable.json (renamed from src/test/resources/spider/SimpleUnsolvable.json)0
-rw-r--r--solvitaire/src/test/test_helper.cpp (renamed from src/test/test_helper.cpp)0
-rw-r--r--solvitaire/src/test/test_helper.h (renamed from src/test/test_helper.h)0
-rw-r--r--solvitaire/src/test/unit_tests/built_group_move_gen_test.cpp (renamed from src/test/unit_tests/built_group_move_gen_test.cpp)0
-rw-r--r--solvitaire/src/test/unit_tests/card_test.cpp (renamed from src/test/unit_tests/card_test.cpp)0
-rw-r--r--solvitaire/src/test/unit_tests/deal_parser_test.cpp (renamed from src/test/unit_tests/deal_parser_test.cpp)0
-rw-r--r--solvitaire/src/test/unit_tests/face_up_cards_test.cpp (renamed from src/test/unit_tests/face_up_cards_test.cpp)0
-rw-r--r--solvitaire/src/test/unit_tests/foundations_dominance_test.cpp (renamed from src/test/unit_tests/foundations_dominance_test.cpp)0
-rw-r--r--solvitaire/src/test/unit_tests/global_cache_test.cpp (renamed from src/test/unit_tests/global_cache_test.cpp)0
-rw-r--r--solvitaire/src/test/unit_tests/k_plus_stock_test.cpp (renamed from src/test/unit_tests/k_plus_stock_test.cpp)0
-rw-r--r--solvitaire/src/test/unit_tests/legal_move_gen_test.cpp (renamed from src/test/unit_tests/legal_move_gen_test.cpp)0
-rw-r--r--solvitaire/src/test/unit_tests/pile_test.cpp (renamed from src/test/unit_tests/pile_test.cpp)0
l---------solvitaire/unit-tests (renamed from unit-tests)0
l---------solvitaire/unit-tests-debug (renamed from unit-tests-debug)0
-rw-r--r--src/main/api.cpp46
-rw-r--r--src/main/api.h71
m---------thpool0
221 files changed, 540 insertions, 289 deletions
diff --git a/.gitignore b/.gitignore
index 2d87bf1..a32de96 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,65 +1,4 @@
-*.o
*.d
-centre
-
-#########
-# CLion #
-#########
-
-# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
-# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
-
-# User-specific stuff:
-.idea/**/workspace.xml
-.idea/**/tasks.xml
-.idea/dictionaries
-
-# Sensitive or high-churn files:
-.idea/**/dataSources/
-.idea/**/dataSources.ids
-.idea/**/dataSources.xml
-.idea/**/dataSources.local.xml
-.idea/**/sqlDataSources.xml
-.idea/**/dynamic.xml
-.idea/**/uiDesigner.xml
-
-# Gradle:
-.idea/**/gradle.xml
-.idea/**/libraries
-
-# CMake
-cmake-build-debug/
-cmake-build-release/
-
-# Mongo Explorer plugin:
-.idea/**/mongoSettings.xml
-
-## File-based project format:
-*.iws
-
-## Plugin-specific files:
-
-# IntelliJ
-out/
-
-# mpeltonen/sbt-idea plugin
-.idea_modules/
-
-# JIRA plugin
-atlassian-ide-plugin.xml
-
-# Cursive Clojure plugin
-.idea/replstate.xml
-
-# Crashlytics plugin (for Android Studio and IntelliJ)
-com_crashlytics_export_strings.xml
-crashlytics.properties
-crashlytics-build.properties
-fabric.properties
-
-###
-
-results/
-
+*.o
-venv/
+centre
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..bae3d98
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "thpool"]
+ path = thpool
+ url = git@github.com:Pithikos/C-Thread-Pool
diff --git a/Makefile b/Makefile
index 3fc65d1..8add398 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,14 @@
LINK.o = $(LINK.cc)
-CXXFLAGS = -ggdb3 -O0 -pedantic -Wall -Werror #-DNOTHREAD
-LDFLAGS = -ggdb3 -O0 -Lcmake-build-release #-DNOTHREAD
+CXXFLAGS = -ggdb3 -Og -pedantic -Wall -Werror #-DNOTHREAD
+LDFLAGS = -ggdb3 -Og -Lsolvitaire #-DNOTHREAD
OUTPUT_OPTION = -MMD -MP -o $@
-LDLIBS = -lapi -lpthread
+LDLIBS = -lsol -lpthread
TRGT = centre
-SRC = metasol.cpp centre.cpp
-OBJ = $(SRC:.cpp=.o)
-DEP = $(SRC:.cpp=.d)
+SRC = metasol.cpp centre.cpp thpool/thpool.c
+OBJ = metasol.o centre.o thpool/thpool.o
+DEP = metasol.d centre.d thpool/thpool.d
.PHONY: default all run
diff --git a/centre.cpp b/centre.cpp
index 8aac7ab..7f958d9 100644
--- a/centre.cpp
+++ b/centre.cpp
@@ -1,7 +1,8 @@
#include <iostream>
+#include <algorithm>
#include "metasol.h"
-#include "src/main/api.h"
+#include "solvitaire/headers/api.h"
sol_rules::build_policy convert_build_policy(build_policy_t bp) {
switch (bp) {
@@ -129,17 +130,20 @@ sol_rules convert_rules(ms_rules *sr) {
assert(sr->deck_count <= 2);
r.two_decks = sr->deck_count == 2;
- if (sr->specific_foundations_base)
+ if (sr->specific_foundations_base) {
r.foundations_base = sr->foundations_base;
- else
- r.foundations_base = boost::optional<card::rank_t>{};
+ } else {
+ r.foundations_base = boost::none;
+ }
- for (auto &p : sr->accordion_moves)
+ for (auto &p : sr->accordion_moves) {
r.accordion_moves.push_back(std::pair<sol_rules::direction, uint8_t>
(convert_direction(p.first), p.second));
+ }
- for (auto &x : sr->accordion_policy)
+ for (auto &x : sr->accordion_policy) {
r.accordion_pol.push_back(convert_accordion_policy(x));
+ }
return r;
}
@@ -258,7 +262,9 @@ game_state convert_game_state(ms_game_state *sgs, ms_rules *r) {
convert_game_state_pile(&sgs->waste, &suits, &ranks, &face_down);
}
}
- // TODO: how does the reserve work? leaving empty for now
+ if (r->reserve_size) {
+ convert_game_state_pile(&sgs->reserve, &suits, &ranks, &face_down);
+ }
// TODO: how does the accordion work? leaving empty for now
convert_game_state_pile_set(&sgs->tableau, &suits, &ranks, &face_down);
// TODO: how does the sequence work? leaving empty for now
@@ -288,43 +294,85 @@ bool goes_through_stock(move *a) {
&& a->count != 0;
}
-int convert_move(ms_game_state *gs, move *m, ms_move *sm) {
+unsigned get_waste_index(ms_rules *r) {
+ assert(r->stock_deal_method == STOCK_TO_WASTE);
+
+ unsigned i = 1;
+ if (r->hole_present) {
+ ++i;
+ }
+
+ if (r->foundations_present) {
+ i += 4 * r->deck_count;
+ }
+
+ i += r->cells;
+
+ return i;
+}
+
+int convert_move(ms_game_state *gs, ms_rules *r, move *m, ms_move *sm) {
sm->stock = goes_through_stock(m);
if (m->type == move::mtype::stock_k_plus) {
- sm->from = &gs->waste;
+ sm->from = get_waste_index(r);
+
+ // if the move is a k+ move, then this value only matters if it doesn't
+ // go through the stock, in which case `m->count == 0` but we want it to
+ // move one card from the waste.
+ sm->size = 1;
} else {
- sm->from = get_pile_by_index(gs, m->from);
+ sm->from = m->from;
+ sm->size = m->count;
}
- sm->to = get_pile_by_index(gs, m->to);
+ sm->to = m->to;
return 0;
}
+finished_state convert_result(solver::result::type r) {
+ switch (r) {
+ case solver::result::type::SOLVED:
+ return SOLUTION_FOUND;
+ case solver::result::type::UNSOLVABLE:
+ return NO_SOLUTION;
+ case solver::result::type::TIMEOUT:
+ case solver::result::type::MEM_LIMIT:
+ case solver::result::type::TERMINATED:
+ return CANCELLED;
+ default:
+ assert(false);
+ }
+}
+
/**
* The function that is called by every voter, to get its vote.
*/
finished_state run_single(ms_game_state *gs, ms_rules *r,
- ms_move *first_move, unsigned move_count, void *data) {
- // TODO: this function can't currently handle producing multiple moves at
- // once
- assert(move_count == 1u);
-
+ std::vector<ms_move> *moves, unsigned move_count, void *data) {
user_data *d = (user_data *) data;
game_state solv_gs = convert_game_state(gs, r);
movelist ml;
- finished_state result = get_moves(ml, solv_gs, d->run_cache_size,
- d->run_timeout);
+ finished_state result = convert_result(get_moves(ml, solv_gs,
+ d->run_cache_size, d->run_timeout));
if (result == SOLUTION_FOUND) {
- if (!is_dud_move(&ml[0])) {
- convert_move(gs, &ml[0], first_move);
- } else {
- convert_move(gs, &ml[1], first_move);
- }
+ unsigned n = std::min(move_count, (unsigned) ml.size());
+ moves->clear();
+ moves->resize(n);
+ int skip_first = is_dud_move(&ml[0]) ? 1 : 0;
+ std::transform(ml.begin() + skip_first,
+ ml.begin() + skip_first + move_count,
+ moves->begin(),
+ [gs, r](move m) -> ms_move {
+ ms_move out;
+ convert_move(gs, r, &m, &out);
+ return out;
+ });
+ std::reverse(moves->begin(), moves->end());
}
return result;
@@ -338,7 +386,8 @@ finished_state thoughtful_run(ms_game_state *gs, ms_rules *r,
game_state solv_gs = convert_game_state(gs, r);
movelist ml;
- return get_moves(ml, solv_gs, d->run_cache_size, d->thoughtful_run_timeout);
+ return convert_result(get_moves(ml, solv_gs, d->run_cache_size,
+ d->thoughtful_run_timeout));
}
ms_rules fortunes_favor() {
@@ -355,6 +404,73 @@ ms_rules fortunes_favor() {
return r;
}
+ms_rules klondike() {
+ ms_rules r = fetch_default_rules();
+
+ r.tableau_size = 7u;
+ r.build_policy = BUILD_ALTERNATING;
+ r.spaces_policy = KINGS_FILL_SPACE;
+ r.move_built_group = CAN_MOVE_BUILT_GROUP;
+ r.built_group_policy = r.build_policy;
+
+ r.diagonal_deal = true;
+ r.face_up_policy = TOP_CARDS_FACE_UP;
+
+ r.foundations_removable = true;
+
+ r.stock_size = 24u;
+ r.stock_deal_count = 3u;
+ r.stock_redeal = true;
+
+ return r;
+}
+
+ms_rules canfield() {
+ ms_rules r = fetch_default_rules();
+
+ r.tableau_size = 4u;
+ r.build_policy = BUILD_ALTERNATING;
+ r.move_built_group = CAN_MOVE_WHOLE_PILE;
+ r.spaces_policy = AUTO_RESERVE_THEN_WASTE;
+ r.built_group_policy = r.build_policy;
+
+ r.foundations_init_cards = ONE_FOUNDATION_INIT;
+ r.specific_foundations_base = false;
+
+ r.stock_size = 34u;
+ r.stock_deal_count = 3u;
+ r.stock_redeal = true;
+
+ r.reserve_size = 13u;
+ r.reserve_stacked = true;
+
+ return r;
+}
+
+ms_rules simple_canfield() {
+ ms_rules r = fetch_default_rules();
+
+ r.tableau_size = 3u;
+ r.build_policy = BUILD_ALTERNATING;
+ r.move_built_group = CAN_MOVE_WHOLE_PILE;
+ r.spaces_policy = AUTO_RESERVE_THEN_WASTE;
+ r.built_group_policy = r.build_policy;
+
+ r.foundations_init_cards = ONE_FOUNDATION_INIT;
+ r.specific_foundations_base = false;
+
+ r.stock_size = 6u;
+ r.stock_deal_count = 3u;
+ r.stock_redeal = true;
+
+ r.reserve_size = 2;
+ r.reserve_stacked = true;
+
+ r.max_rank = 3u;
+
+ return r;
+}
+
bool solved(ms_game_state *gs, ms_rules *r, void *d) {
return convert_game_state(gs, r).is_solved();
}
@@ -366,9 +482,11 @@ ms_settings get_settings(user_data *d) {
s.thoughtful_run_func = &thoughtful_run;
s.solved_func = &solved;
- s.reserved_move_count = 1u;
+ s.reserved_move_count = 10u;
+ s.max_concurrent_threads = 24u;
+ s.max_votes = 1000u;
- s.user_data = d;
+ s.user_data = (void *) d;
return s;
}
@@ -377,17 +495,17 @@ user_data get_user_data() {
user_data d;
d.run_cache_size = 1024u;
- d.run_timeout = 3000u;
- d.thoughtful_run_timeout = 10000u;
+ d.run_timeout = 20000u;
+ d.thoughtful_run_timeout = 20000u;
return d;
}
int main() {
- ms_rules r = fortunes_favor();
+ ms_rules r = klondike();
user_data d = get_user_data();
ms_settings s = get_settings(&d);
ms_game_state gs = random_game_state(&r, &s);
- ms_run(&gs, &r, &s);
+ return ms_run(&gs, &r, &s);
}
diff --git a/metasol.cpp b/metasol.cpp
index 1f18390..98ec4eb 100644
--- a/metasol.cpp
+++ b/metasol.cpp
@@ -4,6 +4,8 @@
#include <assert.h>
+#include "thpool/thpool.h"
+
#include "metasol.h"
#ifndef NDEBUG
@@ -21,6 +23,8 @@ ms_settings fetch_default_settings() {
s.solved_func = NULL;
s.reserved_move_count = 1u;
s.user_data = NULL;
+ s.max_concurrent_threads = 4u;
+ s.max_votes = 100u;
return s;
}
@@ -98,10 +102,10 @@ void add_hidden(ms_card *c, std::vector<ms_card *> &cs) {
* Fills a vector with pointers to all hidden cards in the given game state.
*/
int get_hidden_cards(ms_game_state *gs, std::vector<ms_card *> &cs) {
- // TODO: include reserve, cells, accordion
+ // TODO: include cells, accordion
for (auto &c : gs->stock) add_hidden(&c, cs);
for (auto &c : gs->waste) add_hidden(&c, cs);
- /* for (ms_card &c : gs->reserve) add_hidden(&c, cs); */
+ for (auto &c : gs->reserve) add_hidden(&c, cs);
for (ms_card_pile &p : gs->foundations)
for (ms_card &c : p)
@@ -128,14 +132,16 @@ unsigned total_pile_count(ms_rules *r) {
+ r->cells
+ (r->stock_size > 0 ?
(r->stock_deal_method == STOCK_TO_WASTE ? 2 : 1) : 0)
+ + (r->reserve_size > 0 ? 1 : 0)
;
- // TODO: I'm not sure how the reserve, sequence, or accordion work;
+ // TODO: I'm not sure how the sequence, or accordion work;
// research required!
}
std::random_device rd;
-auto rng = std::default_random_engine{rd()};
+auto seed = static_cast<long unsigned int>(time(0));
+auto rng = std::default_random_engine{seed};
int shuffle_hidden(ms_game_state *gs) {
std::vector<ms_card *> hidden_card_pointers;
@@ -156,23 +162,38 @@ int shuffle_hidden(ms_game_state *gs) {
return 0;
}
-ms_card_pile *get_pile_by_index(ms_game_state *gs, uint8_t i) {
+ms_card_pile *get_pile_by_index(ms_game_state *gs, ms_rules *r, uint8_t i) {
if (i < gs->foundations.size()) {
return &gs->foundations[i];
} else {
i -= gs->foundations.size();
}
- if (i-- == 0) {
- return &gs->stock;
+ if (r->stock_size) {
+ if (i-- == 0) {
+ return &gs->stock;
+ }
+
+ if (r->stock_deal_method == STOCK_TO_WASTE) {
+ if (i-- == 0) {
+ return &gs->waste;
+ }
+ }
+ }
+
+ if (r->reserve_size) {
+ if (i-- == 0) {
+ return &gs->reserve;
+ }
}
- if (i-- == 0) {
- return &gs->waste;
+ if (i < gs->tableau.size()) {
+ return &gs->tableau[i];
+ } else {
+ i -= gs->tableau.size();
}
- assert (i < gs->tableau.size());
- return &gs->tableau[i];
+ assert(false);
}
void *run_thread(void *vargp) {
@@ -200,32 +221,58 @@ int intlen(int i) {
return floor(log10(abs(i))) + 1;
}
-int move_atop(ms_card_pile *f, ms_card_pile *t) {
- ms_card c = f->back();
-
- f->pop_back();
+int move_atop(ms_card_pile *f, ms_card_pile *t, unsigned count, bool *reveal) {
+ ms_card_pile temp(f->end() - count, f->end());
+ f->erase(f->end() - count, f->end());
+ t->insert(t->end(), temp.begin(), temp.end());
if (!f->empty()) {
+ if (reveal) {
+ *reveal = *reveal || f->back().hidden;
+ }
f->back().hidden = false;
}
- t->push_back(c);
+ debug("%s\n", *reveal ? "true" : "false");
+ return 0;
+}
+
+int flip_waste(ms_game_state *gs) {
+ auto temp = gs->waste;
+ gs->waste = gs->stock;
+ gs->stock = temp;
+ std::reverse(gs->stock.begin(), gs->stock.end());
return 0;
}
-int go_through_stock(ms_game_state *gs, int n) {
- for (int i = 0; i < n; ++i)
- move_atop(&gs->stock, &gs->waste);
+int go_through_stock(ms_game_state *gs, unsigned n, bool *reveal) {
+ // going through the stock is treated strangely, so recalculations are
+ // always required
+ *reveal = true;
+
+ if (gs->stock.size() == 0) {
+ flip_waste(gs);
+ }
+
+ unsigned turn_over = std::min(n, (unsigned) gs->stock.size());
+
+ for (unsigned i = 0; i < turn_over; ++i) {
+ move_atop(&gs->stock, &gs->waste, 1u, reveal);
+ }
return 0;
}
-int make_move(ms_game_state *gs, ms_move *m) {
+int make_move(ms_game_state *gs, ms_rules *r, ms_move *m, bool *reveal) {
+ *reveal = false;
+
if (m->stock) {
- go_through_stock(gs, 1);
+ go_through_stock(gs, r->stock_deal_count, reveal);
} else {
- move_atop(m->from, m->to);
+ ms_card_pile *from = get_pile_by_index(gs, r, m->from);
+ ms_card_pile *to = get_pile_by_index(gs, r, m->to);
+ move_atop(from, to, m->size, reveal);
}
return 0;
}
@@ -241,40 +288,67 @@ char const *finished_state_str(finished_state f) {
}
}
-void run_loop(ms_game_state *gs, ms_rules *r, ms_settings *s, ms_move *votes,
- finished_state *vote_results, pthread_t *votes_tid) {
- struct thread_info t_infos[MAX_VOTES];
+bool opposite_move(ms_move *a, ms_move *b) {
+ if (!a || !b) {
+ return false;
+ } else if (a->stock || b->stock) {
+ return false;
+ } else if (a->from != b->to) {
+ return false;
+ } else if (a->to != b->from) {
+ return false;
+ } else if (a->size != b->size) {
+ return false;
+ } else {
+ return true;
+ }
+}
-#ifdef NOTHREAD
- for (int i = 0; i < MAX_VOTES; ++i) {
- t_infos[i].gs = gs;
+void run_loop(ms_game_state *gs, ms_rules *r, ms_settings *s,
+ std::vector<ms_move> *votes, finished_state *vote_results,
+ ms_move *previous_move, bool *card_revealed_last_move,
+ threadpool *thpool, thread_info *t_infos, ms_game_state *shuffled_states
+ ) {
+
+ for (unsigned i = 0; i < s->max_votes; ++i) {
+ if (vote_results[i] == SOLUTION_FOUND
+ && !votes[i].empty()
+ && !*card_revealed_last_move) {
+ continue;
+ }
+
+ shuffled_states[i] = *gs;
+ shuffle_hidden(&shuffled_states[i]);
+
+ t_infos[i].gs = &shuffled_states[i];
t_infos[i].r = r;
t_infos[i].s = s;
t_infos[i].move_buf = &votes[i];
t_infos[i].result = &vote_results[i];
+#ifdef NOTHREAD
+
run_thread(&t_infos[i]);
- }
-#else
- for (int i = 0; i < MAX_VOTES; ++i) {
- t_infos[i].gs = gs;
- t_infos[i].r = r;
- t_infos[i].s = s;
- t_infos[i].move_buf = &votes[i];
- t_infos[i].result = &vote_results[i];
+#else
- pthread_create(&votes_tid[i], NULL, &run_thread, &t_infos[i]);
+ thpool_add_work(*thpool, (void (*)(void *)) &run_thread,
+ (void *) &t_infos[i]);
}
- for (int i = 0; i < MAX_VOTES; ++i)
- pthread_join(votes_tid[i], NULL);
+ thpool_wait(*thpool);
+
#endif
std::map<ms_move, int> tallied_votes;
- for (int i = 0; i < MAX_VOTES; ++i) {
+ for (unsigned i = 0; i < s->max_votes; ++i) {
if (vote_results[i] == SOLUTION_FOUND) {
- ms_move vote = votes[i];
+ assert(!votes[i].empty());
+ debug("votes[%d]: %lu\n", i, votes[i].size());
+
+ ms_move vote = votes[i].back();
+ votes[i].pop_back();
+
auto t = tallied_votes.find(vote);
if (t == tallied_votes.end()) {
tallied_votes[vote] = 1;
@@ -290,7 +364,9 @@ void run_loop(ms_game_state *gs, ms_rules *r, ms_settings *s, ms_move *votes,
ms_move move = v.first;
int vote = v.second;
- if (vote > max_votes) {
+ debug("%u->%u(%u) has %d votes\n", move.from, move.to, move.size, vote);
+
+ if (vote > max_votes) {// && !opposite_move(&move, previous_move)) {
max_move = &move;
max_votes = vote;
}
@@ -300,7 +376,7 @@ void run_loop(ms_game_state *gs, ms_rules *r, ms_settings *s, ms_move *votes,
debug("no votes cast!\n");
std::map<finished_state, int> res;
- for (int i = 0; i < MAX_VOTES; ++i) {
+ for (unsigned i = 0; i < s->max_votes; ++i) {
finished_state f = vote_results[i];
auto c = res.find(f);
res[f] = (c == res.end()) ? 1 : (c->second + 1);
@@ -311,7 +387,8 @@ void run_loop(ms_game_state *gs, ms_rules *r, ms_settings *s, ms_move *votes,
debug("%s: %d\n", finished_state_str(p.first), p.second);
}
} else {
- make_move(gs, max_move);
+ make_move(gs, r, max_move, card_revealed_last_move);
+ *previous_move = *max_move;
}
}
@@ -328,18 +405,28 @@ bool solvable(ms_game_state *gs, ms_rules *r, ms_settings *s) {
return result;
}
-void ms_run(ms_game_state *gs, ms_rules *r, ms_settings *s) {
- ms_move votes[MAX_VOTES];
- finished_state vote_results[MAX_VOTES];
- pthread_t votes_tid[MAX_VOTES];
+int ms_run(ms_game_state *gs, ms_rules *r, ms_settings *s) {
+#define gimme_mem(t) ((t *) malloc(sizeof(t) * s->max_votes))
+ std::vector<ms_move> *votes = gimme_mem(std::vector<ms_move>);
+ finished_state *vote_results = gimme_mem(finished_state);
+ thread_info *t_infos = gimme_mem(thread_info);
+ ms_game_state *states = gimme_mem(ms_game_state);
+ threadpool thpool = thpool_init(s->max_concurrent_threads);
+
+ bool reveal = true;
+ ms_move previous_move;
+ previous_move.stock = true;
while (!s->solved_func(gs, r, s->user_data)) {
if (s->thoughtful_run_func && !solvable(gs, r, s)) {
- break;
+ return 1;
}
- run_loop(gs, r, s, &votes[0], &vote_results[0], &votes_tid[0]);
+ run_loop(gs, r, s, votes, vote_results, &previous_move,
+ &reveal, &thpool, t_infos, states);
}
+ debug("successful seed: %lu\n", seed);
+ return 0;
}
ms_rules fetch_default_rules() {
@@ -480,11 +567,22 @@ ms_game_state random_game_state(ms_rules *r, ms_settings *s) {
}
gs.tableau.resize(r->tableau_size);
- for (auto &t : gs.tableau) {
- ms_card c = deck.back();
- deck.pop_back();
- c.hidden = false;
- t.push_back(c);
+ if (r->diagonal_deal) {
+ for (unsigned i = 0; i < gs.tableau.size(); ++i) {
+ for (unsigned j = 0; j <= i; ++j) {
+ ms_card c = deck.back();
+ deck.pop_back();
+ gs.tableau[i].push_back(c);
+ }
+ gs.tableau[i].back().hidden = false;
+ }
+ } else {
+ for (auto &t : gs.tableau) {
+ ms_card c = deck.back();
+ deck.pop_back();
+ c.hidden = false;
+ t.push_back(c);
+ }
}
if (r->stock_size) {
@@ -496,7 +594,16 @@ ms_game_state random_game_state(ms_rules *r, ms_settings *s) {
gs.stock.back().hidden = false;
}
- // TODO: cells, reserve, accordion
+ if (r->reserve_size) {
+ for (unsigned i = 0; i < r->reserve_size; ++i) {
+ ms_card c = deck.back();
+ deck.pop_back();
+ gs.reserve.push_back(c);
+ }
+ gs.reserve.back().hidden = false;
+ }
+
+ // TODO: cells, accordion
assert(deck.empty());
diff --git a/metasol.h b/metasol.h
index 64a8ac8..e05d186 100644
--- a/metasol.h
+++ b/metasol.h
@@ -94,12 +94,14 @@ typedef struct ms_game_state {
std::vector<ms_card_pile> tableau;
ms_card_pile hole;
std::vector<ms_card_pile> cells;
+ ms_card_pile reserve;
} ms_game_state;
typedef struct ms_move {
bool stock;
- ms_card_pile *to;
- ms_card_pile *from;
+ unsigned to;
+ unsigned from;
+ unsigned size;
} ms_move;
enum finished_state {
@@ -108,8 +110,8 @@ enum finished_state {
typedef finished_state thoughtful_run_func_t(ms_game_state *,
ms_rules *, void *);
-typedef finished_state run_func_t(ms_game_state *, ms_rules *, ms_move *,
- unsigned, void *);
+typedef finished_state run_func_t(ms_game_state *, ms_rules *,
+ std::vector<ms_move> *, unsigned, void *);
typedef bool solved_func_t(ms_game_state *, ms_rules *, void *);
typedef struct ms_settings {
@@ -118,6 +120,8 @@ typedef struct ms_settings {
solved_func_t *solved_func;
unsigned reserved_move_count;
void *user_data;
+ unsigned max_concurrent_threads;
+ unsigned max_votes;
} ms_settings;
unsigned foundation_count(ms_rules *r);
@@ -129,18 +133,15 @@ struct thread_info {
ms_game_state *gs;
ms_rules *r;
ms_settings *s;
- ms_move *move_buf;
+ std::vector<ms_move> *move_buf;
finished_state *result;
};
-const int MAX_VOTES = 100;
-const int MIN_VOTES = 50;
-
ms_rules fetch_default_rules();
ms_settings fetch_default_settings();
ms_game_state random_game_state(ms_rules *, ms_settings *);
-void ms_run(ms_game_state *, ms_rules *, ms_settings *);
+int ms_run(ms_game_state *, ms_rules *, ms_settings *);
#endif /* METASOL_H */
diff --git a/solvitaire/.gitignore b/solvitaire/.gitignore
new file mode 100644
index 0000000..f4fd4db
--- /dev/null
+++ b/solvitaire/.gitignore
@@ -0,0 +1,61 @@
+#########
+# CLion #
+#########
+
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff:
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/dictionaries
+
+# Sensitive or high-churn files:
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.xml
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+
+# Gradle:
+.idea/**/gradle.xml
+.idea/**/libraries
+
+# CMake
+cmake-build-debug/
+cmake-build-release/
+
+# Mongo Explorer plugin:
+.idea/**/mongoSettings.xml
+
+## File-based project format:
+*.iws
+
+## Plugin-specific files:
+
+# IntelliJ
+out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+###
+
+results/
+
+
+venv/
diff --git a/.idea/.name b/solvitaire/.idea/.name
index 9d853fa..9d853fa 100644
--- a/.idea/.name
+++ b/solvitaire/.idea/.name
diff --git a/.idea/Solvitaire.iml b/solvitaire/.idea/Solvitaire.iml
index 070b671..070b671 100644
--- a/.idea/Solvitaire.iml
+++ b/solvitaire/.idea/Solvitaire.iml
diff --git a/.idea/codeStyleSettings.xml b/solvitaire/.idea/codeStyleSettings.xml
index 8c27bb1..8c27bb1 100644
--- a/.idea/codeStyleSettings.xml
+++ b/solvitaire/.idea/codeStyleSettings.xml
diff --git a/.idea/codeStyles/Project.xml b/solvitaire/.idea/codeStyles/Project.xml
index 30aa626..30aa626 100644
--- a/.idea/codeStyles/Project.xml
+++ b/solvitaire/.idea/codeStyles/Project.xml
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/solvitaire/.idea/codeStyles/codeStyleConfig.xml
index a55e7a1..a55e7a1 100644
--- a/.idea/codeStyles/codeStyleConfig.xml
+++ b/solvitaire/.idea/codeStyles/codeStyleConfig.xml
diff --git a/.idea/misc.xml b/solvitaire/.idea/misc.xml
index 79b3c94..79b3c94 100644
--- a/.idea/misc.xml
+++ b/solvitaire/.idea/misc.xml
diff --git a/.idea/modules.xml b/solvitaire/.idea/modules.xml
index 6bef8dd..6bef8dd 100644
--- a/.idea/modules.xml
+++ b/solvitaire/.idea/modules.xml
diff --git a/.idea/statistic.xml b/solvitaire/.idea/statistic.xml
index 1f847e3..1f847e3 100644
--- a/.idea/statistic.xml
+++ b/solvitaire/.idea/statistic.xml
diff --git a/.idea/vcs.xml b/solvitaire/.idea/vcs.xml
index 94a25f7..94a25f7 100644
--- a/.idea/vcs.xml
+++ b/solvitaire/.idea/vcs.xml
diff --git a/CMakeLists.txt b/solvitaire/CMakeLists.txt
index 121c475..3d85ae5 100644
--- a/CMakeLists.txt
+++ b/solvitaire/CMakeLists.txt
@@ -163,10 +163,10 @@ add_executable(solvitaire ${main} ${sources})
set_property(TARGET solvitaire PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) # For -flto flag
target_link_libraries(solvitaire LINK_PUBLIC ${Boost_LIBRARIES})
-add_library(api STATIC ${sources})
-set_target_properties(api PROPERTIES PUBLIC_HEADER src/main/api.h)
-set_property(TARGET api PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) # For -flto flag
-target_link_libraries(api LINK_PUBLIC ${Boost_LIBRARIES})
+add_library(sol STATIC ${sources})
+set_target_properties(sol PROPERTIES PUBLIC_HEADER src/main/api.h)
+set_property(TARGET sol PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) # For -flto flag
+target_link_libraries(sol LINK_PUBLIC ${Boost_LIBRARIES})
# add a separete executable for the 'no pile symmetry' version of the solver
#add_executable(solvitaire-no-pile-symmetry ${main} ${sources})
diff --git a/CMakeLists.txt.in b/solvitaire/CMakeLists.txt.in
index 4c67ef5..4c67ef5 100644
--- a/CMakeLists.txt.in
+++ b/solvitaire/CMakeLists.txt.in
diff --git a/Dockerfile b/solvitaire/Dockerfile
index 7a63b5b..7a63b5b 100644
--- a/Dockerfile
+++ b/solvitaire/Dockerfile
diff --git a/README.md b/solvitaire/README.md
index 8644da4..8644da4 100644
--- a/README.md
+++ b/solvitaire/README.md
diff --git a/archive/README.md b/solvitaire/archive/README.md
index f31f44a..f31f44a 100644
--- a/archive/README.md
+++ b/solvitaire/archive/README.md
diff --git a/archive/build-notes.md b/solvitaire/archive/build-notes.md
index c7aca09..c7aca09 100644
--- a/archive/build-notes.md
+++ b/solvitaire/archive/build-notes.md
diff --git a/archive/canfield-check.py b/solvitaire/archive/canfield-check.py
index 2bfd974..2bfd974 100644
--- a/archive/canfield-check.py
+++ b/solvitaire/archive/canfield-check.py
diff --git a/archive/clean-build.sh b/solvitaire/archive/clean-build.sh
index ce17b8a..ce17b8a 100755
--- a/archive/clean-build.sh
+++ b/solvitaire/archive/clean-build.sh
diff --git a/archive/docs/DOER-document/main.tex b/solvitaire/archive/docs/DOER-document/main.tex
index 400c6b6..400c6b6 100644
--- a/archive/docs/DOER-document/main.tex
+++ b/solvitaire/archive/docs/DOER-document/main.tex
diff --git a/archive/docs/DOER-document/references.bib b/solvitaire/archive/docs/DOER-document/references.bib
index ae852d6..ae852d6 100644
--- a/archive/docs/DOER-document/references.bib
+++ b/solvitaire/archive/docs/DOER-document/references.bib
diff --git a/archive/docs/project-tools.md b/solvitaire/archive/docs/project-tools.md
index 4bbfed8..4bbfed8 100644
--- a/archive/docs/project-tools.md
+++ b/solvitaire/archive/docs/project-tools.md
diff --git a/archive/docs/supervisor-meetings/2017-09-12.md b/solvitaire/archive/docs/supervisor-meetings/2017-09-12.md
index 0124022..0124022 100644
--- a/archive/docs/supervisor-meetings/2017-09-12.md
+++ b/solvitaire/archive/docs/supervisor-meetings/2017-09-12.md
diff --git a/archive/docs/supervisor-meetings/2017-09-19.md b/solvitaire/archive/docs/supervisor-meetings/2017-09-19.md
index 0e39748..0e39748 100644
--- a/archive/docs/supervisor-meetings/2017-09-19.md
+++ b/solvitaire/archive/docs/supervisor-meetings/2017-09-19.md
diff --git a/archive/docs/supervisor-meetings/2017-09-25.md b/solvitaire/archive/docs/supervisor-meetings/2017-09-25.md
index b7c3a6e..b7c3a6e 100644
--- a/archive/docs/supervisor-meetings/2017-09-25.md
+++ b/solvitaire/archive/docs/supervisor-meetings/2017-09-25.md
diff --git a/archive/docs/supervisor-meetings/2017-10-03.md b/solvitaire/archive/docs/supervisor-meetings/2017-10-03.md
index f43b9aa..f43b9aa 100644
--- a/archive/docs/supervisor-meetings/2017-10-03.md
+++ b/solvitaire/archive/docs/supervisor-meetings/2017-10-03.md
diff --git a/archive/docs/supervisor-meetings/2017-10-12.md b/solvitaire/archive/docs/supervisor-meetings/2017-10-12.md
index 6360a6d..6360a6d 100644
--- a/archive/docs/supervisor-meetings/2017-10-12.md
+++ b/solvitaire/archive/docs/supervisor-meetings/2017-10-12.md
diff --git a/archive/docs/supervisor-meetings/2017-10-17.md b/solvitaire/archive/docs/supervisor-meetings/2017-10-17.md
index 99ecd47..99ecd47 100644
--- a/archive/docs/supervisor-meetings/2017-10-17.md
+++ b/solvitaire/archive/docs/supervisor-meetings/2017-10-17.md
diff --git a/archive/docs/supervisor-meetings/2017-10-24.md b/solvitaire/archive/docs/supervisor-meetings/2017-10-24.md
index 80ad93f..80ad93f 100644
--- a/archive/docs/supervisor-meetings/2017-10-24.md
+++ b/solvitaire/archive/docs/supervisor-meetings/2017-10-24.md
diff --git a/archive/docs/supervisor-meetings/2017-10-31.md b/solvitaire/archive/docs/supervisor-meetings/2017-10-31.md
index 2083af0..2083af0 100644
--- a/archive/docs/supervisor-meetings/2017-10-31.md
+++ b/solvitaire/archive/docs/supervisor-meetings/2017-10-31.md
diff --git a/archive/docs/supervisor-meetings/2017-11-07.md b/solvitaire/archive/docs/supervisor-meetings/2017-11-07.md
index 9dae911..9dae911 100644
--- a/archive/docs/supervisor-meetings/2017-11-07.md
+++ b/solvitaire/archive/docs/supervisor-meetings/2017-11-07.md
diff --git a/archive/docs/supervisor-meetings/2017-11-14.md b/solvitaire/archive/docs/supervisor-meetings/2017-11-14.md
index b112a99..b112a99 100644
--- a/archive/docs/supervisor-meetings/2017-11-14.md
+++ b/solvitaire/archive/docs/supervisor-meetings/2017-11-14.md
diff --git a/archive/docs/supervisor-meetings/2017-11-28.md b/solvitaire/archive/docs/supervisor-meetings/2017-11-28.md
index 8d927ee..8d927ee 100644
--- a/archive/docs/supervisor-meetings/2017-11-28.md
+++ b/solvitaire/archive/docs/supervisor-meetings/2017-11-28.md
diff --git a/archive/docs/supervisor-meetings/2018-02-01.md b/solvitaire/archive/docs/supervisor-meetings/2018-02-01.md
index bd141ba..bd141ba 100644
--- a/archive/docs/supervisor-meetings/2018-02-01.md
+++ b/solvitaire/archive/docs/supervisor-meetings/2018-02-01.md
diff --git a/archive/docs/supervisor-meetings/2018-02-08.md b/solvitaire/archive/docs/supervisor-meetings/2018-02-08.md
index fd43fbe..fd43fbe 100644
--- a/archive/docs/supervisor-meetings/2018-02-08.md
+++ b/solvitaire/archive/docs/supervisor-meetings/2018-02-08.md
diff --git a/archive/generate-results-optimisations-off.sh b/solvitaire/archive/generate-results-optimisations-off.sh
index 510fa50..510fa50 100755
--- a/archive/generate-results-optimisations-off.sh
+++ b/solvitaire/archive/generate-results-optimisations-off.sh
diff --git a/archive/optimisation-test.py b/solvitaire/archive/optimisation-test.py
index 594b9eb..594b9eb 100644
--- a/archive/optimisation-test.py
+++ b/solvitaire/archive/optimisation-test.py
diff --git a/archive/real-benchmark.sh b/solvitaire/archive/real-benchmark.sh
index 1e7f7b3..1e7f7b3 100755
--- a/archive/real-benchmark.sh
+++ b/solvitaire/archive/real-benchmark.sh
diff --git a/archive/repeat_deal.sh b/solvitaire/archive/repeat_deal.sh
index f33440f..f33440f 100755
--- a/archive/repeat_deal.sh
+++ b/solvitaire/archive/repeat_deal.sh
diff --git a/build.sh b/solvitaire/build.sh
index 58b846b..58b846b 100755
--- a/build.sh
+++ b/solvitaire/build.sh
diff --git a/docker-install.sh b/solvitaire/docker-install.sh
index 9438c5d..9438c5d 100755
--- a/docker-install.sh
+++ b/solvitaire/docker-install.sh
diff --git a/enter-container.sh b/solvitaire/enter-container.sh
index ac0c78d..ac0c78d 100755
--- a/enter-container.sh
+++ b/solvitaire/enter-container.sh
diff --git a/generate-results.sh b/solvitaire/generate-results.sh
index 33e92de..33e92de 100755
--- a/generate-results.sh
+++ b/solvitaire/generate-results.sh
diff --git a/solvitaire/headers b/solvitaire/headers
new file mode 120000
index 0000000..f315e29
--- /dev/null
+++ b/solvitaire/headers
@@ -0,0 +1 @@
+/cs/home/trh/metasol/solvitaire/src/main \ No newline at end of file
diff --git a/lib/rapidjson/allocators.h b/solvitaire/lib/rapidjson/allocators.h
index 655f4a3..655f4a3 100644
--- a/lib/rapidjson/allocators.h
+++ b/solvitaire/lib/rapidjson/allocators.h
diff --git a/lib/rapidjson/cursorstreamwrapper.h b/solvitaire/lib/rapidjson/cursorstreamwrapper.h
index 52c11a7..52c11a7 100644
--- a/lib/rapidjson/cursorstreamwrapper.h
+++ b/solvitaire/lib/rapidjson/cursorstreamwrapper.h
diff --git a/lib/rapidjson/document.h b/solvitaire/lib/rapidjson/document.h
index a6acc24..a6acc24 100644
--- a/lib/rapidjson/document.h
+++ b/solvitaire/lib/rapidjson/document.h
diff --git a/lib/rapidjson/encodedstream.h b/solvitaire/lib/rapidjson/encodedstream.h
index 223601c..223601c 100644
--- a/lib/rapidjson/encodedstream.h
+++ b/solvitaire/lib/rapidjson/encodedstream.h
diff --git a/lib/rapidjson/encodings.h b/solvitaire/lib/rapidjson/encodings.h
index 7903e76..7903e76 100644
--- a/lib/rapidjson/encodings.h
+++ b/solvitaire/lib/rapidjson/encodings.h
diff --git a/lib/rapidjson/error/en.h b/solvitaire/lib/rapidjson/error/en.h
index 2db838b..2db838b 100644
--- a/lib/rapidjson/error/en.h
+++ b/solvitaire/lib/rapidjson/error/en.h
diff --git a/lib/rapidjson/error/error.h b/solvitaire/lib/rapidjson/error/error.h
index 9311d2f..9311d2f 100644
--- a/lib/rapidjson/error/error.h
+++ b/solvitaire/lib/rapidjson/error/error.h
diff --git a/lib/rapidjson/filereadstream.h b/solvitaire/lib/rapidjson/filereadstream.h
index f1bfb7d..f1bfb7d 100644
--- a/lib/rapidjson/filereadstream.h
+++ b/solvitaire/lib/rapidjson/filereadstream.h
diff --git a/lib/rapidjson/filewritestream.h b/solvitaire/lib/rapidjson/filewritestream.h
index 8b48fee..8b48fee 100644
--- a/lib/rapidjson/filewritestream.h
+++ b/solvitaire/lib/rapidjson/filewritestream.h
diff --git a/lib/rapidjson/fwd.h b/solvitaire/lib/rapidjson/fwd.h
index e8104e8..e8104e8 100644
--- a/lib/rapidjson/fwd.h
+++ b/solvitaire/lib/rapidjson/fwd.h
diff --git a/lib/rapidjson/internal/biginteger.h b/solvitaire/lib/rapidjson/internal/biginteger.h
index f936a10..f936a10 100644
--- a/lib/rapidjson/internal/biginteger.h
+++ b/solvitaire/lib/rapidjson/internal/biginteger.h
diff --git a/lib/rapidjson/internal/diyfp.h b/solvitaire/lib/rapidjson/internal/diyfp.h
index 29abf80..29abf80 100644
--- a/lib/rapidjson/internal/diyfp.h
+++ b/solvitaire/lib/rapidjson/internal/diyfp.h
diff --git a/lib/rapidjson/internal/dtoa.h b/solvitaire/lib/rapidjson/internal/dtoa.h
index bf2e9b2..bf2e9b2 100644
--- a/lib/rapidjson/internal/dtoa.h
+++ b/solvitaire/lib/rapidjson/internal/dtoa.h
diff --git a/lib/rapidjson/internal/ieee754.h b/solvitaire/lib/rapidjson/internal/ieee754.h
index c2684ba..c2684ba 100644
--- a/lib/rapidjson/internal/ieee754.h
+++ b/solvitaire/lib/rapidjson/internal/ieee754.h
diff --git a/lib/rapidjson/internal/itoa.h b/solvitaire/lib/rapidjson/internal/itoa.h
index a39accb..a39accb 100644
--- a/lib/rapidjson/internal/itoa.h
+++ b/solvitaire/lib/rapidjson/internal/itoa.h
diff --git a/lib/rapidjson/internal/meta.h b/solvitaire/lib/rapidjson/internal/meta.h
index 5a9aaa4..5a9aaa4 100644
--- a/lib/rapidjson/internal/meta.h
+++ b/solvitaire/lib/rapidjson/internal/meta.h
diff --git a/lib/rapidjson/internal/pow10.h b/solvitaire/lib/rapidjson/internal/pow10.h
index 02f475d..02f475d 100644
--- a/lib/rapidjson/internal/pow10.h
+++ b/solvitaire/lib/rapidjson/internal/pow10.h
diff --git a/lib/rapidjson/internal/regex.h b/solvitaire/lib/rapidjson/internal/regex.h
index e1a2faa..e1a2faa 100644
--- a/lib/rapidjson/internal/regex.h
+++ b/solvitaire/lib/rapidjson/internal/regex.h
diff --git a/lib/rapidjson/internal/stack.h b/solvitaire/lib/rapidjson/internal/stack.h
index 89558d0..89558d0 100644
--- a/lib/rapidjson/internal/stack.h
+++ b/solvitaire/lib/rapidjson/internal/stack.h
diff --git a/lib/rapidjson/internal/strfunc.h b/solvitaire/lib/rapidjson/internal/strfunc.h
index 226439a..226439a 100644
--- a/lib/rapidjson/internal/strfunc.h
+++ b/solvitaire/lib/rapidjson/internal/strfunc.h
diff --git a/lib/rapidjson/internal/strtod.h b/solvitaire/lib/rapidjson/internal/strtod.h
index adf49e3..adf49e3 100644
--- a/lib/rapidjson/internal/strtod.h
+++ b/solvitaire/lib/rapidjson/internal/strtod.h
diff --git a/lib/rapidjson/internal/swap.h b/solvitaire/lib/rapidjson/internal/swap.h
index 666e49f..666e49f 100644
--- a/lib/rapidjson/internal/swap.h
+++ b/solvitaire/lib/rapidjson/internal/swap.h
diff --git a/lib/rapidjson/istreamwrapper.h b/solvitaire/lib/rapidjson/istreamwrapper.h
index 8639c8c..8639c8c 100644
--- a/lib/rapidjson/istreamwrapper.h
+++ b/solvitaire/lib/rapidjson/istreamwrapper.h
diff --git a/lib/rapidjson/memorybuffer.h b/solvitaire/lib/rapidjson/memorybuffer.h
index 39bee1d..39bee1d 100644
--- a/lib/rapidjson/memorybuffer.h
+++ b/solvitaire/lib/rapidjson/memorybuffer.h
diff --git a/lib/rapidjson/memorystream.h b/solvitaire/lib/rapidjson/memorystream.h
index 1d71d8a..1d71d8a 100644
--- a/lib/rapidjson/memorystream.h
+++ b/solvitaire/lib/rapidjson/memorystream.h
diff --git a/lib/rapidjson/msinttypes/inttypes.h b/solvitaire/lib/rapidjson/msinttypes/inttypes.h
index 1811128..1811128 100644
--- a/lib/rapidjson/msinttypes/inttypes.h
+++ b/solvitaire/lib/rapidjson/msinttypes/inttypes.h
diff --git a/lib/rapidjson/msinttypes/stdint.h b/solvitaire/lib/rapidjson/msinttypes/stdint.h
index 3d4477b..3d4477b 100644
--- a/lib/rapidjson/msinttypes/stdint.h
+++ b/solvitaire/lib/rapidjson/msinttypes/stdint.h
diff --git a/lib/rapidjson/ostreamwrapper.h b/solvitaire/lib/rapidjson/ostreamwrapper.h
index 6f4667c..6f4667c 100644
--- a/lib/rapidjson/ostreamwrapper.h
+++ b/solvitaire/lib/rapidjson/ostreamwrapper.h
diff --git a/lib/rapidjson/pointer.h b/solvitaire/lib/rapidjson/pointer.h
index 8bcb85e..8bcb85e 100644
--- a/lib/rapidjson/pointer.h
+++ b/solvitaire/lib/rapidjson/pointer.h
diff --git a/lib/rapidjson/prettywriter.h b/solvitaire/lib/rapidjson/prettywriter.h
index 95bb6ff..95bb6ff 100644
--- a/lib/rapidjson/prettywriter.h
+++ b/solvitaire/lib/rapidjson/prettywriter.h
diff --git a/lib/rapidjson/rapidjson.h b/solvitaire/lib/rapidjson/rapidjson.h
index 98332fa..98332fa 100644
--- a/lib/rapidjson/rapidjson.h
+++ b/solvitaire/lib/rapidjson/rapidjson.h
diff --git a/lib/rapidjson/reader.h b/solvitaire/lib/rapidjson/reader.h
index 084efaa..084efaa 100644
--- a/lib/rapidjson/reader.h
+++ b/solvitaire/lib/rapidjson/reader.h
diff --git a/lib/rapidjson/schema.h b/solvitaire/lib/rapidjson/schema.h
index 35748cc..35748cc 100644
--- a/lib/rapidjson/schema.h
+++ b/solvitaire/lib/rapidjson/schema.h
diff --git a/lib/rapidjson/stream.h b/solvitaire/lib/rapidjson/stream.h
index 7f2643e..7f2643e 100644
--- a/lib/rapidjson/stream.h
+++ b/solvitaire/lib/rapidjson/stream.h
diff --git a/lib/rapidjson/stringbuffer.h b/solvitaire/lib/rapidjson/stringbuffer.h
index 4e38b82..4e38b82 100644
--- a/lib/rapidjson/stringbuffer.h
+++ b/solvitaire/lib/rapidjson/stringbuffer.h
diff --git a/lib/rapidjson/writer.h b/solvitaire/lib/rapidjson/writer.h
index a978891..a978891 100644
--- a/lib/rapidjson/writer.h
+++ b/solvitaire/lib/rapidjson/writer.h
diff --git a/solvitaire/libsol.a b/solvitaire/libsol.a
new file mode 120000
index 0000000..ac628a2
--- /dev/null
+++ b/solvitaire/libsol.a
@@ -0,0 +1 @@
+/cs/home/trh/metasol/solvitaire/cmake-build-release/libsol.a \ No newline at end of file
diff --git a/resources/deal-presets/ImpossibleFreeCell11982.json b/solvitaire/resources/deal-presets/ImpossibleFreeCell11982.json
index 2ff12e2..2ff12e2 100644
--- a/resources/deal-presets/ImpossibleFreeCell11982.json
+++ b/solvitaire/resources/deal-presets/ImpossibleFreeCell11982.json
diff --git a/resources/deal-presets/alinaSF100.json b/solvitaire/resources/deal-presets/alinaSF100.json
index 1d87fa9..1d87fa9 100644
--- a/resources/deal-presets/alinaSF100.json
+++ b/solvitaire/resources/deal-presets/alinaSF100.json
diff --git a/resources/deal-presets/bg0.json b/solvitaire/resources/deal-presets/bg0.json
index af39512..af39512 100644
--- a/resources/deal-presets/bg0.json
+++ b/solvitaire/resources/deal-presets/bg0.json
diff --git a/resources/deal-presets/bg1.json b/solvitaire/resources/deal-presets/bg1.json
index 3bdef80..3bdef80 100644
--- a/resources/deal-presets/bg1.json
+++ b/solvitaire/resources/deal-presets/bg1.json
diff --git a/resources/deal-presets/bg10.json b/solvitaire/resources/deal-presets/bg10.json
index 6b64d5a..6b64d5a 100644
--- a/resources/deal-presets/bg10.json
+++ b/solvitaire/resources/deal-presets/bg10.json
diff --git a/resources/deal-presets/bg14.json b/solvitaire/resources/deal-presets/bg14.json
index 74592c0..74592c0 100644
--- a/resources/deal-presets/bg14.json
+++ b/solvitaire/resources/deal-presets/bg14.json
diff --git a/resources/deal-presets/err_klondike.json b/solvitaire/resources/deal-presets/err_klondike.json
index e42ec67..e42ec67 100644
--- a/resources/deal-presets/err_klondike.json
+++ b/solvitaire/resources/deal-presets/err_klondike.json
diff --git a/resources/deal-presets/klondikeSM1.json b/solvitaire/resources/deal-presets/klondikeSM1.json
index 402c09b..402c09b 100644
--- a/resources/deal-presets/klondikeSM1.json
+++ b/solvitaire/resources/deal-presets/klondikeSM1.json
diff --git a/resources/deal-presets/klondikeSM2.json b/solvitaire/resources/deal-presets/klondikeSM2.json
index 02e2712..02e2712 100644
--- a/resources/deal-presets/klondikeSM2.json
+++ b/solvitaire/resources/deal-presets/klondikeSM2.json
diff --git a/resources/deal-presets/raglan-ipg.json b/solvitaire/resources/deal-presets/raglan-ipg.json
index 8ad04fe..8ad04fe 100644
--- a/resources/deal-presets/raglan-ipg.json
+++ b/solvitaire/resources/deal-presets/raglan-ipg.json
diff --git a/resources/deal-presets/shootMeKlondikeConverter.py b/solvitaire/resources/deal-presets/shootMeKlondikeConverter.py
index 5c5c226..5c5c226 100644
--- a/resources/deal-presets/shootMeKlondikeConverter.py
+++ b/solvitaire/resources/deal-presets/shootMeKlondikeConverter.py
diff --git a/resources/positional_games.json b/solvitaire/resources/positional_games.json
index 3339379..3339379 100644
--- a/resources/positional_games.json
+++ b/solvitaire/resources/positional_games.json
diff --git a/solvability.sh b/solvitaire/solvability.sh
index 6f423b5..6f423b5 100755
--- a/solvability.sh
+++ b/solvitaire/solvability.sh
diff --git a/solvitaire b/solvitaire/solvitaire
index 65ad3c5..65ad3c5 120000
--- a/solvitaire
+++ b/solvitaire/solvitaire
diff --git a/solvitaire-debug b/solvitaire/solvitaire-debug
index a824555..a824555 120000
--- a/solvitaire-debug
+++ b/solvitaire/solvitaire-debug
diff --git a/solvitaire/src/main/api.cpp b/solvitaire/src/main/api.cpp
new file mode 100644
index 0000000..1cf187c
--- /dev/null
+++ b/solvitaire/src/main/api.cpp
@@ -0,0 +1,24 @@
+#include <cstdint>
+#include <vector>
+#include <string>
+
+#include "game/search-state/game_state.h"
+#include "solver/solver.h"
+
+#include "api.h"
+
+solver::result::type get_moves(std::vector<move>& moves, game_state& gs,
+ uint64_t cache_capacity, uint64_t timeout) {
+ moves.clear();
+
+ solver sol(gs, cache_capacity);
+ solver::result res = sol.run(std::chrono::milliseconds(timeout));
+ if (res.sol_type == solver::result::type::SOLVED) {
+ std::vector<solver::node> nodes = sol.get_frontier();
+ for (auto &it : nodes) {
+ moves.push_back(it.mv);
+ }
+ }
+
+ return res.sol_type;
+}
diff --git a/solvitaire/src/main/api.h b/solvitaire/src/main/api.h
new file mode 100644
index 0000000..09b083d
--- /dev/null
+++ b/solvitaire/src/main/api.h
@@ -0,0 +1,117 @@
+#include <cstdint>
+#include <vector>
+#include <string>
+#include <list>
+
+#include "game/card.h"
+#include "game/move.h"
+#include "game/sol_rules.h"
+
+#ifndef SOLVITAIRE_SOLVER_H
+namespace solver {
+ namespace result {
+ enum class type {
+ TIMEOUT, SOLVED, UNSOLVABLE, MEM_LIMIT, TERMINATED
+ };
+ }
+}
+#endif
+
+#ifndef SOLVITAIRE_GAME_STATE_H
+class game_state {
+ friend class hasher;
+ friend class global_cache;
+ friend class cached_game_state;
+ friend class deal_parser;
+ friend class state_printer;
+ friend class test_helper;
+ friend class json_helper;
+public:
+ enum class streamliner_options {NONE, AUTO_FOUNDATIONS, SUIT_SYMMETRY, BOTH};
+
+ /* Constructors */
+
+ // Creates a game state representation from a JSON doc
+ game_state(const sol_rules&, const rapidjson::Document&, streamliner_options);
+ // Does the same from a seed
+ game_state(const sol_rules&, int seed, streamliner_options);
+ // Does the same but with an initialiser list (useful for testing)
+ game_state(const sol_rules&, std::initializer_list<std::initializer_list<std::string>>);
+ // Does the same but with vectors
+ game_state(const sol_rules&, std::vector<std::vector<std::string>>);
+ // Does the same but with lots of vectors
+ game_state(const sol_rules&, std::vector<std::vector<card::suit_t>>,
+ std::vector<std::vector<card::rank_t>>,
+ std::vector<std::vector<bool>>);
+
+ /* Altering state */
+
+ void make_move(move);
+ void undo_move(move);
+ void place_card(pile::ref, card);
+ card take_card(pile::ref);
+
+ /* Legal move generation */
+
+ std::vector<move> get_legal_moves(move = move(move::mtype::regular));
+ boost::optional<move> get_dominance_move() const;
+
+ /* State inspection */
+
+ bool is_solved() const;
+ const std::vector<pile>& get_data() const;
+
+ /* Printing */
+
+ friend std::ostream& operator<< (std::ostream&, const game_state&);
+
+private:
+
+ /* Game rules */
+
+ const sol_rules rules;
+ streamliner_options stream_opts;
+ card::rank_t foundations_base;
+
+ /* Pile references */
+
+ std::list<pile::ref> tableau_piles;
+ std::list<pile::ref> cells;
+ pile::ref stock;
+ pile::ref waste;
+ std::list<pile::ref> reserve;
+ std::vector<pile::ref> foundations;
+ std::vector<pile::ref> sequences;
+ std::list<pile::ref> accordion;
+ pile::ref hole;
+
+ /* Pile references of starting/original layout */
+
+ std::vector<pile::ref> original_tableau_piles;
+ std::vector<pile::ref> original_cells;
+ std::vector<pile::ref> original_reserve;
+
+ /* Auto-foundation moves state */
+
+ std::vector<bool> auto_foundation_moves;
+
+ /* Core piles */
+
+ std::vector<pile> piles;
+};
+#endif
+
+typedef std::vector<std::vector<std::string>> piles;
+typedef std::vector<move> movelist;
+
+/**
+ * Populate a move list with a bunch of moves that lead to a solution.
+ *
+ * Clears the list, then, if a solution is found, populates it with the moves
+ * required to realise the solution.
+ *
+ * Returns true if a solution was found; false otherwise.
+ */
+solver::result::type get_moves(movelist& moves, game_state& gs,
+ uint64_t cache_capacity, uint64_t timeout);
+
diff --git a/src/main/evaluation/benchmark.cpp b/solvitaire/src/main/evaluation/benchmark.cpp
index f66573c..f66573c 100644
--- a/src/main/evaluation/benchmark.cpp
+++ b/solvitaire/src/main/evaluation/benchmark.cpp
diff --git a/src/main/evaluation/benchmark.h b/solvitaire/src/main/evaluation/benchmark.h
index b7b9a1d..b7b9a1d 100644
--- a/src/main/evaluation/benchmark.h
+++ b/solvitaire/src/main/evaluation/benchmark.h
diff --git a/src/main/evaluation/binomial_ci.cpp b/solvitaire/src/main/evaluation/binomial_ci.cpp
index c381c05..c381c05 100644
--- a/src/main/evaluation/binomial_ci.cpp
+++ b/solvitaire/src/main/evaluation/binomial_ci.cpp
diff --git a/src/main/evaluation/binomial_ci.h b/solvitaire/src/main/evaluation/binomial_ci.h
index 6e2dceb..6e2dceb 100644
--- a/src/main/evaluation/binomial_ci.h
+++ b/solvitaire/src/main/evaluation/binomial_ci.h
diff --git a/src/main/evaluation/solvability_calc.cpp b/solvitaire/src/main/evaluation/solvability_calc.cpp
index 14219ab..14219ab 100644
--- a/src/main/evaluation/solvability_calc.cpp
+++ b/solvitaire/src/main/evaluation/solvability_calc.cpp
diff --git a/src/main/evaluation/solvability_calc.h b/solvitaire/src/main/evaluation/solvability_calc.h
index 25eb844..25eb844 100644
--- a/src/main/evaluation/solvability_calc.h
+++ b/solvitaire/src/main/evaluation/solvability_calc.h
diff --git a/src/main/game/card.cpp b/solvitaire/src/main/game/card.cpp
index 60aaa74..60aaa74 100644
--- a/src/main/game/card.cpp
+++ b/solvitaire/src/main/game/card.cpp
diff --git a/src/main/game/card.h b/solvitaire/src/main/game/card.h
index 7885d66..7885d66 100644
--- a/src/main/game/card.h
+++ b/solvitaire/src/main/game/card.h
diff --git a/src/main/game/global_cache.cpp b/solvitaire/src/main/game/global_cache.cpp
index 079ed77..079ed77 100644
--- a/src/main/game/global_cache.cpp
+++ b/solvitaire/src/main/game/global_cache.cpp
diff --git a/src/main/game/global_cache.h b/solvitaire/src/main/game/global_cache.h
index e9bb412..e9bb412 100644
--- a/src/main/game/global_cache.h
+++ b/solvitaire/src/main/game/global_cache.h
diff --git a/src/main/game/move.cpp b/solvitaire/src/main/game/move.cpp
index b349ddd..b349ddd 100644
--- a/src/main/game/move.cpp
+++ b/solvitaire/src/main/game/move.cpp
diff --git a/src/main/game/move.h b/solvitaire/src/main/game/move.h
index 8250609..8250609 100644
--- a/src/main/game/move.h
+++ b/solvitaire/src/main/game/move.h
diff --git a/src/main/game/pile.cpp b/solvitaire/src/main/game/pile.cpp
index 23a02af..23a02af 100644
--- a/src/main/game/pile.cpp
+++ b/solvitaire/src/main/game/pile.cpp
diff --git a/src/main/game/pile.h b/solvitaire/src/main/game/pile.h
index 5ab2404..5ab2404 100644
--- a/src/main/game/pile.h
+++ b/solvitaire/src/main/game/pile.h
diff --git a/src/main/game/search-state/game_state.cpp b/solvitaire/src/main/game/search-state/game_state.cpp
index 6ea550c..6ea550c 100644
--- a/src/main/game/search-state/game_state.cpp
+++ b/solvitaire/src/main/game/search-state/game_state.cpp
diff --git a/src/main/game/search-state/game_state.dominance_moves.cpp b/solvitaire/src/main/game/search-state/game_state.dominance_moves.cpp
index d0b4b43..d0b4b43 100644
--- a/src/main/game/search-state/game_state.dominance_moves.cpp
+++ b/solvitaire/src/main/game/search-state/game_state.dominance_moves.cpp
diff --git a/src/main/game/search-state/game_state.h b/solvitaire/src/main/game/search-state/game_state.h
index 1698122..1698122 100644
--- a/src/main/game/search-state/game_state.h
+++ b/solvitaire/src/main/game/search-state/game_state.h
diff --git a/src/main/game/search-state/game_state.legal_moves.cpp b/solvitaire/src/main/game/search-state/game_state.legal_moves.cpp
index 63a4764..63a4764 100644
--- a/src/main/game/search-state/game_state.legal_moves.cpp
+++ b/solvitaire/src/main/game/search-state/game_state.legal_moves.cpp
diff --git a/src/main/game/search-state/game_state.pile_order.cpp b/solvitaire/src/main/game/search-state/game_state.pile_order.cpp
index 736cc89..736cc89 100644
--- a/src/main/game/search-state/game_state.pile_order.cpp
+++ b/solvitaire/src/main/game/search-state/game_state.pile_order.cpp
diff --git a/src/main/game/sol_rules.cpp b/solvitaire/src/main/game/sol_rules.cpp
index 940b1a4..940b1a4 100644
--- a/src/main/game/sol_rules.cpp
+++ b/solvitaire/src/main/game/sol_rules.cpp
diff --git a/src/main/game/sol_rules.h b/solvitaire/src/main/game/sol_rules.h
index 6a6b575..6a6b575 100644
--- a/src/main/game/sol_rules.h
+++ b/solvitaire/src/main/game/sol_rules.h
diff --git a/src/main/input-output/input/command_line_helper.cpp b/solvitaire/src/main/input-output/input/command_line_helper.cpp
index ae0f9c4..ae0f9c4 100644
--- a/src/main/input-output/input/command_line_helper.cpp
+++ b/solvitaire/src/main/input-output/input/command_line_helper.cpp
diff --git a/src/main/input-output/input/command_line_helper.h b/solvitaire/src/main/input-output/input/command_line_helper.h
index f2a9d74..f2a9d74 100644
--- a/src/main/input-output/input/command_line_helper.h
+++ b/solvitaire/src/main/input-output/input/command_line_helper.h
diff --git a/src/main/input-output/input/json-parsing/deal_parser.cpp b/solvitaire/src/main/input-output/input/json-parsing/deal_parser.cpp
index 8b8a36a..8b8a36a 100644
--- a/src/main/input-output/input/json-parsing/deal_parser.cpp
+++ b/solvitaire/src/main/input-output/input/json-parsing/deal_parser.cpp
diff --git a/src/main/input-output/input/json-parsing/deal_parser.h b/solvitaire/src/main/input-output/input/json-parsing/deal_parser.h
index 36f58d5..36f58d5 100644
--- a/src/main/input-output/input/json-parsing/deal_parser.h
+++ b/solvitaire/src/main/input-output/input/json-parsing/deal_parser.h
diff --git a/src/main/input-output/input/json-parsing/json_helper.cpp b/solvitaire/src/main/input-output/input/json-parsing/json_helper.cpp
index 3e6b99c..3e6b99c 100644
--- a/src/main/input-output/input/json-parsing/json_helper.cpp
+++ b/solvitaire/src/main/input-output/input/json-parsing/json_helper.cpp
diff --git a/src/main/input-output/input/json-parsing/json_helper.h b/solvitaire/src/main/input-output/input/json-parsing/json_helper.h
index 460911f..460911f 100644
--- a/src/main/input-output/input/json-parsing/json_helper.h
+++ b/solvitaire/src/main/input-output/input/json-parsing/json_helper.h
diff --git a/src/main/input-output/input/json-parsing/rules_parser.cpp b/solvitaire/src/main/input-output/input/json-parsing/rules_parser.cpp
index 7c49577..7c49577 100644
--- a/src/main/input-output/input/json-parsing/rules_parser.cpp
+++ b/solvitaire/src/main/input-output/input/json-parsing/rules_parser.cpp
diff --git a/src/main/input-output/input/json-parsing/rules_parser.h b/solvitaire/src/main/input-output/input/json-parsing/rules_parser.h
index fdfe018..fdfe018 100644
--- a/src/main/input-output/input/json-parsing/rules_parser.h
+++ b/solvitaire/src/main/input-output/input/json-parsing/rules_parser.h
diff --git a/src/main/input-output/input/sol_preset_types.cpp b/solvitaire/src/main/input-output/input/sol_preset_types.cpp
index b169370..b169370 100644
--- a/src/main/input-output/input/sol_preset_types.cpp
+++ b/solvitaire/src/main/input-output/input/sol_preset_types.cpp
diff --git a/src/main/input-output/input/sol_preset_types.h b/solvitaire/src/main/input-output/input/sol_preset_types.h
index c5b27d3..c5b27d3 100644
--- a/src/main/input-output/input/sol_preset_types.h
+++ b/solvitaire/src/main/input-output/input/sol_preset_types.h
diff --git a/src/main/input-output/output/log_helper.h b/solvitaire/src/main/input-output/output/log_helper.h
index 7762250..7762250 100644
--- a/src/main/input-output/output/log_helper.h
+++ b/solvitaire/src/main/input-output/output/log_helper.h
diff --git a/src/main/input-output/output/state_printer.cpp b/solvitaire/src/main/input-output/output/state_printer.cpp
index 3f1978b..3f1978b 100644
--- a/src/main/input-output/output/state_printer.cpp
+++ b/solvitaire/src/main/input-output/output/state_printer.cpp
diff --git a/src/main/input-output/output/state_printer.h b/solvitaire/src/main/input-output/output/state_printer.h
index 575b973..575b973 100644
--- a/src/main/input-output/output/state_printer.h
+++ b/solvitaire/src/main/input-output/output/state_printer.h
diff --git a/src/main/main.cpp b/solvitaire/src/main/main.cpp
index faed0ca..faed0ca 100644
--- a/src/main/main.cpp
+++ b/solvitaire/src/main/main.cpp
diff --git a/src/main/solver/solver.cpp b/solvitaire/src/main/solver/solver.cpp
index e10396f..e10396f 100644
--- a/src/main/solver/solver.cpp
+++ b/solvitaire/src/main/solver/solver.cpp
diff --git a/src/main/solver/solver.h b/solvitaire/src/main/solver/solver.h
index fec3f4b..74c73a8 100644
--- a/src/main/solver/solver.h
+++ b/solvitaire/src/main/solver/solver.h
@@ -26,11 +26,7 @@ public:
};
struct result {
-#ifdef C2NIM
- enum type { TIMEOUT, SOLVED, UNSOLVABLE, MEM_LIMIT, TERMINATED };
-#else
enum class type { TIMEOUT, SOLVED, UNSOLVABLE, MEM_LIMIT, TERMINATED };
-#endif
type sol_type;
uint64_t states_searched;
diff --git a/src/test/integration_tests/accordion_test.cpp b/solvitaire/src/test/integration_tests/accordion_test.cpp
index bd27dec..bd27dec 100644
--- a/src/test/integration_tests/accordion_test.cpp
+++ b/solvitaire/src/test/integration_tests/accordion_test.cpp
diff --git a/src/test/integration_tests/alpha_star_test.cpp b/solvitaire/src/test/integration_tests/alpha_star_test.cpp
index c3b23fe..c3b23fe 100644
--- a/src/test/integration_tests/alpha_star_test.cpp
+++ b/solvitaire/src/test/integration_tests/alpha_star_test.cpp
diff --git a/src/test/integration_tests/bakers_dozen_test.cpp b/solvitaire/src/test/integration_tests/bakers_dozen_test.cpp
index f3d4763..f3d4763 100644
--- a/src/test/integration_tests/bakers_dozen_test.cpp
+++ b/solvitaire/src/test/integration_tests/bakers_dozen_test.cpp
diff --git a/src/test/integration_tests/black_hole_test.cpp b/solvitaire/src/test/integration_tests/black_hole_test.cpp
index a0f6707..a0f6707 100644
--- a/src/test/integration_tests/black_hole_test.cpp
+++ b/solvitaire/src/test/integration_tests/black_hole_test.cpp
diff --git a/src/test/integration_tests/canfield_test.cpp b/solvitaire/src/test/integration_tests/canfield_test.cpp
index 0cb14b2..0cb14b2 100644
--- a/src/test/integration_tests/canfield_test.cpp
+++ b/solvitaire/src/test/integration_tests/canfield_test.cpp
diff --git a/src/test/integration_tests/flower_garden_test.cpp b/solvitaire/src/test/integration_tests/flower_garden_test.cpp
index 641ccc0..641ccc0 100644
--- a/src/test/integration_tests/flower_garden_test.cpp
+++ b/solvitaire/src/test/integration_tests/flower_garden_test.cpp
diff --git a/src/test/integration_tests/fortunes_favor_test.cpp b/solvitaire/src/test/integration_tests/fortunes_favor_test.cpp
index 5511f9e..5511f9e 100644
--- a/src/test/integration_tests/fortunes_favor_test.cpp
+++ b/solvitaire/src/test/integration_tests/fortunes_favor_test.cpp
diff --git a/src/test/integration_tests/free_cell_test.cpp b/solvitaire/src/test/integration_tests/free_cell_test.cpp
index 659d86b..659d86b 100644
--- a/src/test/integration_tests/free_cell_test.cpp
+++ b/solvitaire/src/test/integration_tests/free_cell_test.cpp
diff --git a/src/test/integration_tests/gaps_test.cpp b/solvitaire/src/test/integration_tests/gaps_test.cpp
index f7d0ebe..f7d0ebe 100644
--- a/src/test/integration_tests/gaps_test.cpp
+++ b/solvitaire/src/test/integration_tests/gaps_test.cpp
diff --git a/src/test/integration_tests/klondike_test.cpp b/solvitaire/src/test/integration_tests/klondike_test.cpp
index d449495..d449495 100644
--- a/src/test/integration_tests/klondike_test.cpp
+++ b/solvitaire/src/test/integration_tests/klondike_test.cpp
diff --git a/src/test/integration_tests/somerset_test.cpp b/solvitaire/src/test/integration_tests/somerset_test.cpp
index fce8e8c..fce8e8c 100644
--- a/src/test/integration_tests/somerset_test.cpp
+++ b/solvitaire/src/test/integration_tests/somerset_test.cpp
diff --git a/src/test/integration_tests/spanish_patience_test.cpp b/solvitaire/src/test/integration_tests/spanish_patience_test.cpp
index da32fd5..da32fd5 100644
--- a/src/test/integration_tests/spanish_patience_test.cpp
+++ b/solvitaire/src/test/integration_tests/spanish_patience_test.cpp
diff --git a/src/test/integration_tests/spider_test.cpp b/solvitaire/src/test/integration_tests/spider_test.cpp
index 50f16fe..50f16fe 100644
--- a/src/test/integration_tests/spider_test.cpp
+++ b/solvitaire/src/test/integration_tests/spider_test.cpp
diff --git a/src/test/resources/accordion/ComplexSolvable.json b/solvitaire/src/test/resources/accordion/ComplexSolvable.json
index cdb2367..cdb2367 100644
--- a/src/test/resources/accordion/ComplexSolvable.json
+++ b/solvitaire/src/test/resources/accordion/ComplexSolvable.json
diff --git a/src/test/resources/accordion/ComplexUnsolvable.json b/solvitaire/src/test/resources/accordion/ComplexUnsolvable.json
index 09c7d32..09c7d32 100644
--- a/src/test/resources/accordion/ComplexUnsolvable.json
+++ b/solvitaire/src/test/resources/accordion/ComplexUnsolvable.json
diff --git a/src/test/resources/accordion/SimpleSolvable.json b/solvitaire/src/test/resources/accordion/SimpleSolvable.json
index 00de391..00de391 100644
--- a/src/test/resources/accordion/SimpleSolvable.json
+++ b/solvitaire/src/test/resources/accordion/SimpleSolvable.json
diff --git a/src/test/resources/accordion/SimpleUnsolvable.json b/solvitaire/src/test/resources/accordion/SimpleUnsolvable.json
index 2e1b9c3..2e1b9c3 100644
--- a/src/test/resources/accordion/SimpleUnsolvable.json
+++ b/solvitaire/src/test/resources/accordion/SimpleUnsolvable.json
diff --git a/src/test/resources/alpha_star/ComplexSolvable.json b/solvitaire/src/test/resources/alpha_star/ComplexSolvable.json
index ab6b24e..ab6b24e 100644
--- a/src/test/resources/alpha_star/ComplexSolvable.json
+++ b/solvitaire/src/test/resources/alpha_star/ComplexSolvable.json
diff --git a/src/test/resources/alpha_star/ComplexUnsolvable.json b/solvitaire/src/test/resources/alpha_star/ComplexUnsolvable.json
index 56ea441..56ea441 100644
--- a/src/test/resources/alpha_star/ComplexUnsolvable.json
+++ b/solvitaire/src/test/resources/alpha_star/ComplexUnsolvable.json
diff --git a/src/test/resources/alpha_star/SimpleSolvable.json b/solvitaire/src/test/resources/alpha_star/SimpleSolvable.json
index 7994021..7994021 100644
--- a/src/test/resources/alpha_star/SimpleSolvable.json
+++ b/solvitaire/src/test/resources/alpha_star/SimpleSolvable.json
diff --git a/src/test/resources/alpha_star/SimpleUnsolvable.json b/solvitaire/src/test/resources/alpha_star/SimpleUnsolvable.json
index ac6741e..ac6741e 100644
--- a/src/test/resources/alpha_star/SimpleUnsolvable.json
+++ b/solvitaire/src/test/resources/alpha_star/SimpleUnsolvable.json
diff --git a/src/test/resources/bakers_dozen/ComplexSolvable.json b/solvitaire/src/test/resources/bakers_dozen/ComplexSolvable.json
index b953413..b953413 100644
--- a/src/test/resources/bakers_dozen/ComplexSolvable.json
+++ b/solvitaire/src/test/resources/bakers_dozen/ComplexSolvable.json
diff --git a/src/test/resources/bakers_dozen/ComplexUnsolvable.json b/solvitaire/src/test/resources/bakers_dozen/ComplexUnsolvable.json
index a8247c4..a8247c4 100644
--- a/src/test/resources/bakers_dozen/ComplexUnsolvable.json
+++ b/solvitaire/src/test/resources/bakers_dozen/ComplexUnsolvable.json
diff --git a/src/test/resources/bakers_dozen/SimpleSolvable.json b/solvitaire/src/test/resources/bakers_dozen/SimpleSolvable.json
index 7c00a71..7c00a71 100644
--- a/src/test/resources/bakers_dozen/SimpleSolvable.json
+++ b/solvitaire/src/test/resources/bakers_dozen/SimpleSolvable.json
diff --git a/src/test/resources/bakers_dozen/SimpleUnsolvable.json b/solvitaire/src/test/resources/bakers_dozen/SimpleUnsolvable.json
index 0b39a8d..0b39a8d 100644
--- a/src/test/resources/bakers_dozen/SimpleUnsolvable.json
+++ b/solvitaire/src/test/resources/bakers_dozen/SimpleUnsolvable.json
diff --git a/src/test/resources/black_hole/ComplexSolvable.json b/solvitaire/src/test/resources/black_hole/ComplexSolvable.json
index 15488e9..15488e9 100644
--- a/src/test/resources/black_hole/ComplexSolvable.json
+++ b/solvitaire/src/test/resources/black_hole/ComplexSolvable.json
diff --git a/src/test/resources/black_hole/ComplexUnsolvable.json b/solvitaire/src/test/resources/black_hole/ComplexUnsolvable.json
index ed4ee99..ed4ee99 100644
--- a/src/test/resources/black_hole/ComplexUnsolvable.json
+++ b/solvitaire/src/test/resources/black_hole/ComplexUnsolvable.json
diff --git a/src/test/resources/black_hole/SimpleSolvable.json b/solvitaire/src/test/resources/black_hole/SimpleSolvable.json
index 3a7be18..3a7be18 100644
--- a/src/test/resources/black_hole/SimpleSolvable.json
+++ b/solvitaire/src/test/resources/black_hole/SimpleSolvable.json
diff --git a/src/test/resources/black_hole/SimpleUnsolvable.json b/solvitaire/src/test/resources/black_hole/SimpleUnsolvable.json
index d6a5e7c..d6a5e7c 100644
--- a/src/test/resources/black_hole/SimpleUnsolvable.json
+++ b/solvitaire/src/test/resources/black_hole/SimpleUnsolvable.json
diff --git a/src/test/resources/canfield/ComplexSolvable.json b/solvitaire/src/test/resources/canfield/ComplexSolvable.json
index 2a4c252..2a4c252 100644
--- a/src/test/resources/canfield/ComplexSolvable.json
+++ b/solvitaire/src/test/resources/canfield/ComplexSolvable.json
diff --git a/src/test/resources/canfield/ComplexUnsolvable.json b/solvitaire/src/test/resources/canfield/ComplexUnsolvable.json
index 297d06b..297d06b 100644
--- a/src/test/resources/canfield/ComplexUnsolvable.json
+++ b/solvitaire/src/test/resources/canfield/ComplexUnsolvable.json
diff --git a/src/test/resources/canfield/SimpleSolvable.json b/solvitaire/src/test/resources/canfield/SimpleSolvable.json
index 3353b5c..3353b5c 100644
--- a/src/test/resources/canfield/SimpleSolvable.json
+++ b/solvitaire/src/test/resources/canfield/SimpleSolvable.json
diff --git a/src/test/resources/canfield/SimpleUnsolvable.json b/solvitaire/src/test/resources/canfield/SimpleUnsolvable.json
index 440c358..440c358 100644
--- a/src/test/resources/canfield/SimpleUnsolvable.json
+++ b/solvitaire/src/test/resources/canfield/SimpleUnsolvable.json
diff --git a/src/test/resources/flower_garden/ComplexSolvable.json b/solvitaire/src/test/resources/flower_garden/ComplexSolvable.json
index 1f1a6e6..1f1a6e6 100644
--- a/src/test/resources/flower_garden/ComplexSolvable.json
+++ b/solvitaire/src/test/resources/flower_garden/ComplexSolvable.json
diff --git a/src/test/resources/flower_garden/ComplexUnsolvable.json b/solvitaire/src/test/resources/flower_garden/ComplexUnsolvable.json
index be0ca64..be0ca64 100644
--- a/src/test/resources/flower_garden/ComplexUnsolvable.json
+++ b/solvitaire/src/test/resources/flower_garden/ComplexUnsolvable.json
diff --git a/src/test/resources/flower_garden/SimpleSolvable.json b/solvitaire/src/test/resources/flower_garden/SimpleSolvable.json
index 18c680d..18c680d 100644
--- a/src/test/resources/flower_garden/SimpleSolvable.json
+++ b/solvitaire/src/test/resources/flower_garden/SimpleSolvable.json
diff --git a/src/test/resources/flower_garden/SimpleUnsolvable.json b/solvitaire/src/test/resources/flower_garden/SimpleUnsolvable.json
index e57e9ca..e57e9ca 100644
--- a/src/test/resources/flower_garden/SimpleUnsolvable.json
+++ b/solvitaire/src/test/resources/flower_garden/SimpleUnsolvable.json
diff --git a/src/test/resources/fortunes_favor/ComplexSolvable.json b/solvitaire/src/test/resources/fortunes_favor/ComplexSolvable.json
index f00d600..f00d600 100644
--- a/src/test/resources/fortunes_favor/ComplexSolvable.json
+++ b/solvitaire/src/test/resources/fortunes_favor/ComplexSolvable.json
diff --git a/src/test/resources/fortunes_favor/ComplexUnsolvable.json b/solvitaire/src/test/resources/fortunes_favor/ComplexUnsolvable.json
index 4f54b94..4f54b94 100644
--- a/src/test/resources/fortunes_favor/ComplexUnsolvable.json
+++ b/solvitaire/src/test/resources/fortunes_favor/ComplexUnsolvable.json
diff --git a/src/test/resources/fortunes_favor/SimpleSolvable.json b/solvitaire/src/test/resources/fortunes_favor/SimpleSolvable.json
index 0891746..0891746 100644
--- a/src/test/resources/fortunes_favor/SimpleSolvable.json
+++ b/solvitaire/src/test/resources/fortunes_favor/SimpleSolvable.json
diff --git a/src/test/resources/fortunes_favor/SimpleUnsolvable.json b/solvitaire/src/test/resources/fortunes_favor/SimpleUnsolvable.json
index 44d7359..44d7359 100644
--- a/src/test/resources/fortunes_favor/SimpleUnsolvable.json
+++ b/solvitaire/src/test/resources/fortunes_favor/SimpleUnsolvable.json
diff --git a/src/test/resources/free_cell/ComplexSolvable.json b/solvitaire/src/test/resources/free_cell/ComplexSolvable.json
index ca370ff..ca370ff 100644
--- a/src/test/resources/free_cell/ComplexSolvable.json
+++ b/solvitaire/src/test/resources/free_cell/ComplexSolvable.json
diff --git a/src/test/resources/free_cell/ComplexUnsolvable.json b/solvitaire/src/test/resources/free_cell/ComplexUnsolvable.json
index 48ac428..48ac428 100644
--- a/src/test/resources/free_cell/ComplexUnsolvable.json
+++ b/solvitaire/src/test/resources/free_cell/ComplexUnsolvable.json
diff --git a/src/test/resources/free_cell/SimpleSolvable.json b/solvitaire/src/test/resources/free_cell/SimpleSolvable.json
index 1bebaf2..1bebaf2 100644
--- a/src/test/resources/free_cell/SimpleSolvable.json
+++ b/solvitaire/src/test/resources/free_cell/SimpleSolvable.json
diff --git a/src/test/resources/free_cell/SimpleUnsolvable.json b/solvitaire/src/test/resources/free_cell/SimpleUnsolvable.json
index 8cdcc26..8cdcc26 100644
--- a/src/test/resources/free_cell/SimpleUnsolvable.json
+++ b/solvitaire/src/test/resources/free_cell/SimpleUnsolvable.json
diff --git a/src/test/resources/gaps/ComplexSolvable.json b/solvitaire/src/test/resources/gaps/ComplexSolvable.json
index f9fcb41..f9fcb41 100644
--- a/src/test/resources/gaps/ComplexSolvable.json
+++ b/solvitaire/src/test/resources/gaps/ComplexSolvable.json
diff --git a/src/test/resources/gaps/ComplexUnsolvable.json b/solvitaire/src/test/resources/gaps/ComplexUnsolvable.json
index 2c9de3e..2c9de3e 100644
--- a/src/test/resources/gaps/ComplexUnsolvable.json
+++ b/solvitaire/src/test/resources/gaps/ComplexUnsolvable.json
diff --git a/src/test/resources/gaps/SimpleSolvable.json b/solvitaire/src/test/resources/gaps/SimpleSolvable.json
index 2e9cdfe..2e9cdfe 100644
--- a/src/test/resources/gaps/SimpleSolvable.json
+++ b/solvitaire/src/test/resources/gaps/SimpleSolvable.json
diff --git a/src/test/resources/gaps/SimpleUnsolvable.json b/solvitaire/src/test/resources/gaps/SimpleUnsolvable.json
index b0c0529..b0c0529 100644
--- a/src/test/resources/gaps/SimpleUnsolvable.json
+++ b/solvitaire/src/test/resources/gaps/SimpleUnsolvable.json
diff --git a/src/test/resources/klondike/ComplexSolvable.json b/solvitaire/src/test/resources/klondike/ComplexSolvable.json
index 8711780..8711780 100644
--- a/src/test/resources/klondike/ComplexSolvable.json
+++ b/solvitaire/src/test/resources/klondike/ComplexSolvable.json
diff --git a/src/test/resources/klondike/ComplexUnsolvable.json b/solvitaire/src/test/resources/klondike/ComplexUnsolvable.json
index 7685ce1..7685ce1 100644
--- a/src/test/resources/klondike/ComplexUnsolvable.json
+++ b/solvitaire/src/test/resources/klondike/ComplexUnsolvable.json
diff --git a/src/test/resources/klondike/SimpleSolvable.json b/solvitaire/src/test/resources/klondike/SimpleSolvable.json
index f54ebbb..f54ebbb 100644
--- a/src/test/resources/klondike/SimpleSolvable.json
+++ b/solvitaire/src/test/resources/klondike/SimpleSolvable.json
diff --git a/src/test/resources/klondike/SimpleUnsolvable.json b/solvitaire/src/test/resources/klondike/SimpleUnsolvable.json
index 21a5854..21a5854 100644
--- a/src/test/resources/klondike/SimpleUnsolvable.json
+++ b/solvitaire/src/test/resources/klondike/SimpleUnsolvable.json
diff --git a/src/test/resources/somerset/ComplexSolvable.json b/solvitaire/src/test/resources/somerset/ComplexSolvable.json
index b316c50..b316c50 100644
--- a/src/test/resources/somerset/ComplexSolvable.json
+++ b/solvitaire/src/test/resources/somerset/ComplexSolvable.json
diff --git a/src/test/resources/somerset/ComplexUnsolvable.json b/solvitaire/src/test/resources/somerset/ComplexUnsolvable.json
index 09d7864..09d7864 100644
--- a/src/test/resources/somerset/ComplexUnsolvable.json
+++ b/solvitaire/src/test/resources/somerset/ComplexUnsolvable.json
diff --git a/src/test/resources/somerset/SimpleSolvable.json b/solvitaire/src/test/resources/somerset/SimpleSolvable.json
index b316c50..b316c50 100644
--- a/src/test/resources/somerset/SimpleSolvable.json
+++ b/solvitaire/src/test/resources/somerset/SimpleSolvable.json
diff --git a/src/test/resources/somerset/SimpleUnsolvable.json b/solvitaire/src/test/resources/somerset/SimpleUnsolvable.json
index 09d7864..09d7864 100644
--- a/src/test/resources/somerset/SimpleUnsolvable.json
+++ b/solvitaire/src/test/resources/somerset/SimpleUnsolvable.json
diff --git a/src/test/resources/spanish_patience/ComplexSolvable.json b/solvitaire/src/test/resources/spanish_patience/ComplexSolvable.json
index c48ce47..c48ce47 100644
--- a/src/test/resources/spanish_patience/ComplexSolvable.json
+++ b/solvitaire/src/test/resources/spanish_patience/ComplexSolvable.json
diff --git a/src/test/resources/spanish_patience/ComplexUnsolvable.json b/solvitaire/src/test/resources/spanish_patience/ComplexUnsolvable.json
index ba9be59..ba9be59 100644
--- a/src/test/resources/spanish_patience/ComplexUnsolvable.json
+++ b/solvitaire/src/test/resources/spanish_patience/ComplexUnsolvable.json
diff --git a/src/test/resources/spanish_patience/SimpleSolvable.json b/solvitaire/src/test/resources/spanish_patience/SimpleSolvable.json
index eacad0e..eacad0e 100644
--- a/src/test/resources/spanish_patience/SimpleSolvable.json
+++ b/solvitaire/src/test/resources/spanish_patience/SimpleSolvable.json
diff --git a/src/test/resources/spanish_patience/SimpleUnsolvable.json b/solvitaire/src/test/resources/spanish_patience/SimpleUnsolvable.json
index 99a3140..99a3140 100644
--- a/src/test/resources/spanish_patience/SimpleUnsolvable.json
+++ b/solvitaire/src/test/resources/spanish_patience/SimpleUnsolvable.json
diff --git a/src/test/resources/spider/ComplexSolvable.json b/solvitaire/src/test/resources/spider/ComplexSolvable.json
index c7d96e2..c7d96e2 100644
--- a/src/test/resources/spider/ComplexSolvable.json
+++ b/solvitaire/src/test/resources/spider/ComplexSolvable.json
diff --git a/src/test/resources/spider/ComplexUnsolvable.json b/solvitaire/src/test/resources/spider/ComplexUnsolvable.json
index 2379c9a..2379c9a 100644
--- a/src/test/resources/spider/ComplexUnsolvable.json
+++ b/solvitaire/src/test/resources/spider/ComplexUnsolvable.json
diff --git a/src/test/resources/spider/SimpleSolvable.json b/solvitaire/src/test/resources/spider/SimpleSolvable.json
index f0b9b00..f0b9b00 100644
--- a/src/test/resources/spider/SimpleSolvable.json
+++ b/solvitaire/src/test/resources/spider/SimpleSolvable.json
diff --git a/src/test/resources/spider/SimpleUnsolvable.json b/solvitaire/src/test/resources/spider/SimpleUnsolvable.json
index d11a6dd..d11a6dd 100644
--- a/src/test/resources/spider/SimpleUnsolvable.json
+++ b/solvitaire/src/test/resources/spider/SimpleUnsolvable.json
diff --git a/src/test/test_helper.cpp b/solvitaire/src/test/test_helper.cpp
index 6cc68aa..6cc68aa 100644
--- a/src/test/test_helper.cpp
+++ b/solvitaire/src/test/test_helper.cpp
diff --git a/src/test/test_helper.h b/solvitaire/src/test/test_helper.h
index 89d28cb..89d28cb 100644
--- a/src/test/test_helper.h
+++ b/solvitaire/src/test/test_helper.h
diff --git a/src/test/unit_tests/built_group_move_gen_test.cpp b/solvitaire/src/test/unit_tests/built_group_move_gen_test.cpp
index 5e3a492..5e3a492 100644
--- a/src/test/unit_tests/built_group_move_gen_test.cpp
+++ b/solvitaire/src/test/unit_tests/built_group_move_gen_test.cpp
diff --git a/src/test/unit_tests/card_test.cpp b/solvitaire/src/test/unit_tests/card_test.cpp
index 346dff9..346dff9 100644
--- a/src/test/unit_tests/card_test.cpp
+++ b/solvitaire/src/test/unit_tests/card_test.cpp
diff --git a/src/test/unit_tests/deal_parser_test.cpp b/solvitaire/src/test/unit_tests/deal_parser_test.cpp
index db2bd31..db2bd31 100644
--- a/src/test/unit_tests/deal_parser_test.cpp
+++ b/solvitaire/src/test/unit_tests/deal_parser_test.cpp
diff --git a/src/test/unit_tests/face_up_cards_test.cpp b/solvitaire/src/test/unit_tests/face_up_cards_test.cpp
index 1311958..1311958 100644
--- a/src/test/unit_tests/face_up_cards_test.cpp
+++ b/solvitaire/src/test/unit_tests/face_up_cards_test.cpp
diff --git a/src/test/unit_tests/foundations_dominance_test.cpp b/solvitaire/src/test/unit_tests/foundations_dominance_test.cpp
index 8fdc285..8fdc285 100644
--- a/src/test/unit_tests/foundations_dominance_test.cpp
+++ b/solvitaire/src/test/unit_tests/foundations_dominance_test.cpp
diff --git a/src/test/unit_tests/global_cache_test.cpp b/solvitaire/src/test/unit_tests/global_cache_test.cpp
index 93ef105..93ef105 100644
--- a/src/test/unit_tests/global_cache_test.cpp
+++ b/solvitaire/src/test/unit_tests/global_cache_test.cpp
diff --git a/src/test/unit_tests/k_plus_stock_test.cpp b/solvitaire/src/test/unit_tests/k_plus_stock_test.cpp
index dcd4410..dcd4410 100644
--- a/src/test/unit_tests/k_plus_stock_test.cpp
+++ b/solvitaire/src/test/unit_tests/k_plus_stock_test.cpp
diff --git a/src/test/unit_tests/legal_move_gen_test.cpp b/solvitaire/src/test/unit_tests/legal_move_gen_test.cpp
index da5c63c..da5c63c 100644
--- a/src/test/unit_tests/legal_move_gen_test.cpp
+++ b/solvitaire/src/test/unit_tests/legal_move_gen_test.cpp
diff --git a/src/test/unit_tests/pile_test.cpp b/solvitaire/src/test/unit_tests/pile_test.cpp
index a5aeb66..a5aeb66 100644
--- a/src/test/unit_tests/pile_test.cpp
+++ b/solvitaire/src/test/unit_tests/pile_test.cpp
diff --git a/unit-tests b/solvitaire/unit-tests
index 9234f13..9234f13 120000
--- a/unit-tests
+++ b/solvitaire/unit-tests
diff --git a/unit-tests-debug b/solvitaire/unit-tests-debug
index a23b263..a23b263 120000
--- a/unit-tests-debug
+++ b/solvitaire/unit-tests-debug
diff --git a/src/main/api.cpp b/src/main/api.cpp
deleted file mode 100644
index 1709a49..0000000
--- a/src/main/api.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <cstdint>
-
-#include <vector>
-#include <string>
-
-#include <stdio.h>
-
-#include "game/move.h"
-#include "game/search-state/game_state.h"
-#include "solver/solver.h"
-
-enum finished_state {
- SOLUTION_FOUND, NO_SOLUTION, TIMEOUT, SOLVER_OOM, CANCELLED
-};
-
-finished_state get_moves(std::vector<move>& moves, game_state& gs,
- uint64_t cache_capacity, uint64_t timeout);
-finished_state get_moves(std::vector<move>& moves, game_state& gs,
- uint64_t cache_capacity, uint64_t timeout) {
- moves.clear();
-
- solver sol(gs, cache_capacity);
- solver::result res = sol.run(std::chrono::milliseconds(timeout));
- if (res.sol_type == solver::result::type::SOLVED) {
- std::vector<solver::node> nodes = sol.get_frontier();
- for (auto &it : nodes) {
- moves.push_back(it.mv);
- }
- }
-
- switch (res.sol_type) {
- case solver::result::type::SOLVED:
- return SOLUTION_FOUND;
- case solver::result::type::UNSOLVABLE:
- return NO_SOLUTION;
- case solver::result::type::TIMEOUT:
- return TIMEOUT;
- case solver::result::type::MEM_LIMIT:
- return SOLVER_OOM;
- case solver::result::type::TERMINATED:
- return CANCELLED;
- default:
- assert(false);
- return NO_SOLUTION;
- }
-}
diff --git a/src/main/api.h b/src/main/api.h
deleted file mode 100644
index 2140d8e..0000000
--- a/src/main/api.h
+++ /dev/null
@@ -1,71 +0,0 @@
-#include <cstdint>
-#include <vector>
-#include <string>
-#include <list>
-
-#include "game/move.h"
-#include "game/sol_rules.h"
-#include "game/card.h"
-
-typedef std::vector<std::vector<std::string>> piles;
-typedef std::vector<move> movelist;
-
-class game_state {
- public:
- game_state(const sol_rules&, piles);
- game_state(const sol_rules&,
- std::vector<std::vector<card::suit_t>>,
- std::vector<std::vector<card::rank_t>>,
- std::vector<std::vector<bool>>);
-
- bool is_solved() const;
-
- enum class streamliner_options {NONE, AUTO_FOUNDATIONS, SUIT_SYMMETRY, BOTH};
- void make_move(move);
-
- friend std::ostream& operator<< (std::ostream&, const game_state&);
-
- private:
- /* Game rules */
-
- const sol_rules rules;
- streamliner_options stream_opts;
- card::rank_t foundations_base;
-
- /* Pile references */
-
- std::list<pile::ref> tableau_piles;
- std::list<pile::ref> cells;
- pile::ref stock;
- pile::ref waste;
- std::list<pile::ref> reserve;
- std::vector<pile::ref> foundations;
- std::vector<pile::ref> sequences;
- std::list<pile::ref> accordion;
- pile::ref hole;
-
- /* Pile references of starting/original layout */
-
- std::vector<pile::ref> original_tableau_piles;
- std::vector<pile::ref> original_cells;
- std::vector<pile::ref> original_reserve;
-
- /* Auto-foundation moves state */
-
- std::vector<bool> auto_foundation_moves;
-
- /* Core piles */
-
- std::vector<pile> piles;
-};
-
-/**
- * Populate a move list with a bunch of moves that lead to a solution.
- *
- * Clears the list, then, if a solution is found, populates it with the moves
- * required to realise the solution.
- *
- * Returns true if a solution was found; false otherwise.
- */
-finished_state get_moves(movelist& moves, game_state& gs,
- uint64_t cache_capacity, uint64_t timeout);
diff --git a/thpool b/thpool
new file mode 160000
+Subproject 430251cb657f82c9a94d4ed72db6f5ea2e30f5d