aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt10
-rw-r--r--benchmark.py12
-rw-r--r--src/main/game/game_state.cpp4
3 files changed, 25 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 39097e0..ba6b41a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -137,6 +137,16 @@ add_executable(solvitaire-no-card-symmetry ${main} ${sources})
target_link_libraries(solvitaire-no-card-symmetry LINK_PUBLIC ${Boost_LIBRARIES} -lprofiler)
set_target_properties(solvitaire-no-card-symmetry PROPERTIES COMPILE_FLAGS -DNO_CARD_SYMMETRY)
+# add a separete executable for the 'no pile symmetry' version of the solver
+add_executable(solvitaire-no-pile-symmetry ${main} ${sources})
+target_link_libraries(solvitaire-no-pile-symmetry LINK_PUBLIC ${Boost_LIBRARIES} -lprofiler)
+set_target_properties(solvitaire-no-pile-symmetry PROPERTIES COMPILE_FLAGS -DNO_PILE_SYMMETRY)
+
+# add a separete executable for the 'no symmetry' version of the solver
+add_executable(solvitaire-no-symmetry ${main} ${sources})
+target_link_libraries(solvitaire-no-symmetry LINK_PUBLIC ${Boost_LIBRARIES} -lprofiler)
+set_target_properties(solvitaire-no-symmetry PROPERTIES COMPILE_FLAGS "-DNO_CARD_SYMMETRY -DNO_PILE_SYMMETRY")
+
# add a separete executable for the 'no reduced state' version of the solver
add_executable(solvitaire-no-reduced-state ${main} ${sources})
target_link_libraries(solvitaire-no-reduced-state LINK_PUBLIC ${Boost_LIBRARIES} -lprofiler)
diff --git a/benchmark.py b/benchmark.py
index 3456b45..10f45dd 100644
--- a/benchmark.py
+++ b/benchmark.py
@@ -19,11 +19,21 @@ if (len(sys.argv) >= 2
flag = ""
if (len(sys.argv) >= 2
- and (sys.argv[1] == "--no-card-symmetry" or sys.argv[1] == "-ps")):
+ and (sys.argv[1] == "--no-card-symmetry" or sys.argv[1] == "-cs")):
flag = "-no-card-symmetry"
print("Running in no-card-symmetry mode...")
if (len(sys.argv) >= 2
+ and (sys.argv[1] == "--no-pile-symmetry" or sys.argv[1] == "-ps")):
+ flag = "-no-pile-symmetry"
+ print("Running in no-pile-symmetry mode...")
+
+if (len(sys.argv) >= 2
+ and (sys.argv[1] == "--no-symmetry" or sys.argv[1] == "-ps")):
+ flag = "-no-symmetry"
+ print("Running in no-symmetry mode...")
+
+if (len(sys.argv) >= 2
and (sys.argv[1] == "--no-reduced-state" or sys.argv[1] == "-rc")):
flag = "-no-reduced-state"
print("Running in no-reduced-state mode...")
diff --git a/src/main/game/game_state.cpp b/src/main/game/game_state.cpp
index 097c744..a6186ff 100644
--- a/src/main/game/game_state.cpp
+++ b/src/main/game/game_state.cpp
@@ -277,13 +277,17 @@ void game_state::undo_move(const move m) {
// reorders the pile refs so that the largest pile is first
void game_state::place_card(pile_ref pr, card c) {
piles[pr].place(c);
+#ifndef NO_PILE_SYMMETRY
eval_pile_order(pr, true);
+#endif
}
// Same as above but for taking cards
card game_state::take_card(pile_ref pr) {
card c = piles[pr].take();
+#ifndef NO_PILE_SYMMETRY
eval_pile_order(pr, false);
+#endif
return c;
}