Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Early finish when all the cascades are alternating #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gzsombor
Copy link

then it can be finished trivially

src/game.rs Outdated
@@ -173,7 +173,7 @@ impl Game {
}

fn is_victory(&self) -> bool {
self.foundations.iter().all(|f| f.is_full())
self.cascades.iter().all(|c| c.has_all_alternating())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This clearly breaks the normal way to finish the game if the last card you're stacking is in a cell.

@IGI-111
Copy link
Owner

IGI-111 commented Aug 21, 2021

I like the idea, but it's kind of abrupt given the rules to suddenly end like this.

Probably better would be to trigger an animation where you stack every possible card automatically when you right click in a trivial scenario.

@gzsombor
Copy link
Author

I've just noticed after thorough testing that this is indeed incorrect, because the game finishes when you pick up the last card, it does not wait until you put into a correct place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants