Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 408027e commit b5846d7Copy full SHA for b5846d7
1 file changed
Demo/tkinter/guido/solitaire.py
@@ -580,14 +580,16 @@ def wincheck(self):
580
def win(self):
581
"""Stupid animation when you win."""
582
cards = []
583
- for s in self.suits:
+ for s in self.openstacks:
584
cards = cards + s.cards
585
- if not cards:
586
- return
587
- for i in range(1000):
+ while cards:
588
card = random.choice(cards)
589
- dx = random.randint(-50, 50)
590
- dy = random.randint(-50, 50)
+ cards.remove(card)
+ self.animatedmoveto(card, self.deck)
+
+ def animatedmoveto(self, card, dest):
591
+ for i in range(10, 0, -1):
592
+ dx, dy = (dest.x-card.x)/i, (dest.y-card.y)/i
593
card.moveby(dx, dy)
594
self.master.update_idletasks()
595
0 commit comments