Skip to content

Early finish when all the cascades are alternating#2

Open
gzsombor wants to merge 2 commits intoIGI-111:masterfrom
gzsombor:finish-condition
Open

Early finish when all the cascades are alternating#2
gzsombor wants to merge 2 commits intoIGI-111:masterfrom
gzsombor:finish-condition

Conversation

@gzsombor
Copy link

then it can be finished trivially

src/game.rs Outdated

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