From 3a781e332c2a2d0d03b1eb35f1538929851aedaa Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Fri, 22 Jun 2018 16:21:37 +0100 Subject: Add simple simon --- .../search-state/game_state.auto_foundation_moves.cpp | 4 +++- src/main/game/search-state/game_state.legal_moves.cpp | 2 +- src/main/input-output/input/sol_preset_types.cpp | 16 ++++++++++++++++ 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 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 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 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 +} +)" + } }; -- cgit v1.2.1