aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/game_state.cpp13
-rw-r--r--src/main/sol_rules.cpp4
2 files changed, 13 insertions, 4 deletions
diff --git a/src/main/game_state.cpp b/src/main/game_state.cpp
index 90a7381..05bfb4f 100644
--- a/src/main/game_state.cpp
+++ b/src/main/game_state.cpp
@@ -87,7 +87,7 @@ game_state::game_state(int seed, const sol_rules& s_rules)
if (rules.cells > 0) {
for (int i = 0; i < rules.cells; i++) {
pile p(true, ord::SINGLE_CARD, pol::ANY_SUIT, false);
- foundations.push_back(p);
+ cells.push_back(p);
}
}
}
@@ -173,6 +173,11 @@ bool game_state::is_solved() const {
return false;
}
}
+ for (auto p : cells) {
+ if (!p.empty()) {
+ return false;
+ }
+ }
return true;
}
@@ -214,7 +219,11 @@ void game_state::print_foundations(ostream& stream) const {
void game_state::print_cells(ostream& stream) const {
for (pile cell : cells) {
- if (!cell.empty()) stream << cells[0] << "\t";
+ if (cells.empty()) {
+ stream << "[]" << "\t";
+ } else {
+ stream << cells[0] << "\t";
+ }
}
stream << "\n";
}
diff --git a/src/main/sol_rules.cpp b/src/main/sol_rules.cpp
index de56254..b98e96d 100644
--- a/src/main/sol_rules.cpp
+++ b/src/main/sol_rules.cpp
@@ -77,8 +77,8 @@ sol_rules::sol_rules(std::string sol_type) {
cells = 4;
break;
case valid_sol::SIMPLE_FREE_CELL:
- tableau_pile_count = 4;
- max_rank = 4;
+ tableau_pile_count = 3;
+ max_rank = 3;
cells = 1;
break;
default: