Uno (Card Game)/Python: Difference between revisions

m
PureFox moved page Uno(Card Game)/Python to Uno (Card Game)/Python: Subpage not linking back to parent due to mis-spelling.
(Created page with "{{collection|Uno_(Card_Game)}} {{trans|Julia}} Uses the Tk library. <lang python>""" Uno Card Game """ from numpy.random import choice, rand, shuffle from time import sleep...")
 
m (PureFox moved page Uno(Card Game)/Python to Uno (Card Game)/Python: Subpage not linking back to parent due to mis-spelling.)
 
(4 intermediate revisions by 2 users not shown)
Line 1:
{{collection|Uno_(Card_Game)}}
 
{{trans|Julia}}
Uses the Tk library.
{{trans|Julia}}
<langsyntaxhighlight lang="python">""" Uno Card Game """
 
from numpy.random import choice, rand, shuffle
Line 85:
shuffle(deck[28:])
 
hands = [deck[i:i+67] for i in range(0, 27, 7)]
 
self.drawpile = drawpile
Line 435:
canvas.create_polygon(30, 500, 800, 500, 800, 690, 30, 690, fill='lightyellow')
canvas.update()
fornrow row= in range(3len(hand): - 1) // 16 + 1
for col in range(12):
drawunocard(canvas, UnoCard('None', ' '), 31 + 50 * col, 500 + 85 * row,
45, 85, 'lightyellow')
nrow = (len(hand) + 15) // 16
for row in range(nrow):
cards = hand[row * 16 : min(len(hand), (row + 1) * 16)]
Line 515 ⟶ 510:
app.setDaemon(True)
app.start()
top.mainloop()</syntaxhighlight>
</lang>
9,476

edits