• Home
  • Raw
  • Download

Lines Matching +full:fill +full:- +full:range

7 - No cute graphical images for the playing cards faces or backs.
8 - No scoring or timer.
9 - No undo.
10 - No option to turn 3 cards at a time.
11 - No keyboard shortcuts.
12 - Less fancy animation when you win.
13 - The determination of which stack you drag to is more relaxed.
41 # Constants determining the size and lay-out of cards and stacks. We
87 # Card values are 1-13. We also define symbolic names for the picture
94 ALLVALUES = range(1, 14) # (one more than the highest value)
102 VALNAMES = ["", "A"] + map(str, range(2, 11)) + ["J", "Q", "K"]
126 moveto(x, y) -- move the card to an absolute position
127 moveby(dx, dy) -- move the card by a relative offset
128 tkraise() -- raise the card to the top of its stack
129 showface(), showback() -- turn the card face up or down & raise it
131 Public read-only instance variables:
133 suit, value, color -- the card's suit, value and color
134 face_shown -- true when the card is shown face up, else false
136 Semi-public read-only instance variables (XXX should be made
139 group -- the Canvas.Group representing the card
140 x, y -- the position of the card's top left corner
144 __back, __rect, __text -- the canvas items making up the card
172 anchor=N, fill=self.color, text=text)
176 outline='black', fill='white')
180 CARDWIDTH-MARGIN, CARDHEIGHT-MARGIN,
181 outline='black', fill='blue')
190 self.moveby(x - self.x, y - self.y)
226 add(card) -- add a card to the stack
227 delete(card) -- delete a card from the stack
228 showtop() -- show the top card (if any) face up
229 deal() -- delete and return the top card, or None if empty
233 position(card) -- move the card to its proper (x, y) position
238 userclickhandler(), userdoubleclickhandler() -- called to do
245 usermovehandler(cards) -- called to complete a subpile move
253 motionhandler(event), releasehandler(event) -- event handlers
259 startmoving(event) -- begin a move operation
260 finishmoving() -- finish a move operation
279 self.group.bind('<Double-1>', self.doubleclickhandler)
280 self.group.bind('<B1-Motion>', self.motionhandler)
281 self.group.bind('<ButtonRelease-1>', self.releasehandler)
305 self.cards[-1].showface()
310 card = self.cards[-1]
355 for i in range(len(self.cards)):
372 dx = event.x - self.lastx
373 dy = event.y - self.lasty
393 fill() -- create the playing cards
394 shuffle() -- shuffle the playing cards
406 outline='black', fill=BACKGROUND)
409 def fill(self): member in Deck
437 """Function returning a random permutation of range(n)."""
438 r = range(n)
466 card = self.cards[-1]
484 outline='black', fill='')
498 topcard = self.cards[-1]
508 topcard = self.cards[-1]
511 return card.color != topcard.color and card.value == topcard.value - 1
535 self.canvas.pack(fill=BOTH, expand=TRUE)
556 for i in range(NSUITS):
564 for i in range(NROWS):
570 self.deck.fill()
591 for i in range(10, 0, -1):
592 dx, dy = (dest.x-card.x)//i, (dest.y-card.y)//i
602 dist = (stack.x - card.x)**2 + (stack.y - card.y)**2
611 for i in range(NROWS):
628 # Main function, run when invoked as a stand-alone Python program.