aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorCharlie Blake2018-06-22 16:21:37 +0100
committerCharlie Blake2018-06-22 16:21:37 +0100
commit3a781e332c2a2d0d03b1eb35f1538929851aedaa (patch)
treecbf562aa47561cca2c961b9dba0b73a6300147d4 /src/main
parentChange move order generation (diff)
downloadmetasol-3a781e332c2a2d0d03b1eb35f1538929851aedaa.tar.gz
metasol-3a781e332c2a2d0d03b1eb35f1538929851aedaa.zip

Add simple simon

Diffstat (limited to 'src/main')
-rw-r--r--src/main/game/search-state/game_state.auto_foundation_moves.cpp4
-rw-r--r--src/main/game/search-state/game_state.legal_moves.cpp2
-rw-r--r--src/main/input-output/input/sol_preset_types.cpp16
3 files changed, 20 insertions, 2 deletions
diff --git a/src/main/game/search-state/game_state.auto_foundation_moves.cpp b/src/main/game/search-state/game_state.auto_foundation_moves.cpp
index 1bec3fe..794c040 100644
--- a/src/main/game/search-state/game_state.auto_foundation_moves.cpp
+++ b/src/main/game/search-state/game_state.auto_foundation_moves.cpp
@@ -11,7 +11,9 @@ using std::max;
bool game_state::is_valid_auto_foundation_move(pile::ref target_pile) const {
- if (streamliners || rules.build_pol == pol::NO_BUILD || rules.build_pol == pol::SAME_SUIT)
+ if (rules.foundations_comp_piles)
+ return false;
+ else if (streamliners || rules.build_pol == pol::NO_BUILD || rules.build_pol == pol::SAME_SUIT)
return true;
card::suit_t target_suit(target_pile - foundations.front());
diff --git a/src/main/game/search-state/game_state.legal_moves.cpp b/src/main/game/search-state/game_state.legal_moves.cpp
index 5fb48df..b7b910e 100644
--- a/src/main/game/search-state/game_state.legal_moves.cpp
+++ b/src/main/game/search-state/game_state.legal_moves.cpp
@@ -117,7 +117,7 @@ vector<move> game_state::get_legal_moves(move parent_move) {
}
// Tableau / cells to hole / foundation moves
- if (rules.hole || rules.foundations) {
+ if (rules.hole || (rules.foundations && !rules.foundations_comp_piles)) {
list<pile::ref> from_piles = tableau_piles;
if (rules.cells > 0) from_piles.insert(from_piles.end(), cells.begin(), cells.end());
if (rules.reserve_size > 0) from_piles.insert(from_piles.end(), reserve.begin(), reserve.end());
diff --git a/src/main/input-output/input/sol_preset_types.cpp b/src/main/input-output/input/sol_preset_types.cpp
index 53141a8..5b751af 100644
--- a/src/main/input-output/input/sol_preset_types.cpp
+++ b/src/main/input-output/input/sol_preset_types.cpp
@@ -928,6 +928,22 @@ map<string, string> sol_preset_types::mp = {
"max rank": 9
}
)"
+ },
+ {
+ "simple-simon",
+
+ R"(
+{
+ "tableau piles": {
+ "count": 10,
+ "diagonal deal": true,
+ "move built group": true,
+ "move built group policy": "same-suit"
+ },
+ "foundations complete piles": true
+}
+)"
+
}
};