flet-dev / examples

Flet sample applications
MIT License
457 stars 189 forks source link

Fix solitaire bugs #99

Closed dharamsk closed 7 months ago

dharamsk commented 11 months ago

Addresses the following solitaire tutorial bugs:

  1. game does not load because card.update() cannot be called before card is added to page during solitaire mount() operations: assert self.__page, "Control must be added to the page first."
  2. cards cannot be moved due to other card.update() operations raising the same error.
  3. card dragging was not being displayed, although drop/place worked fine.
  4. after a win, clicking new game would create a second solitaire instance below the first.

Fixes applied:

I also modified display_waste to function according to normal solitaire rules for 3-card stock draws, and hopefully simplified the behavior.

Note: In one of my early playthroughs, the 9 of spades went missing and I couldn't finish. I never figured out how/why.

CLAassistant commented 11 months ago

CLA assistant check
All committers have signed the CLA.

dharamsk commented 11 months ago

I was thinking my changes to display_waste() might need to be updated in the documentation: https://flet.dev/docs/tutorials/python-solitaire and in the earlier steps of the tutorial but I can't find where the source is for the tutorial.

FeodorFitsner commented 7 months ago

Thank you! It works now!

dharamsk commented 7 months ago

Thanks @FeodorFitsner. Really appreciate this project. Made it really simple to get something from nothing with no UI/Frontend experience 🙌🏼

I'm happy to update the tutorial also though I think the repo might be private? https://flet.dev/docs/tutorials/python-solitaire

ndonkoHenri commented 7 months ago

There's an "edit this page" button at the end of that page. You will land on the corresponding file from there.

dharamsk commented 7 months ago

There's an "edit this page" button at the end of that page. You will land on the corresponding file from there.

Ooh excellent, thanks, I totally missed that 🤦‍♂️