Exemplo n.º 1
0
 def __init__(self, Player: Player, Dealer: Dealer, GameRules: GameRules):
     self.WINDOW_WIDTH = 700
     self.WINDOW_HEIGHT = 700
     self.cardsheet = graphics.GraphicsImage(fileName="cards.png")
     self.background = graphics.GraphicsImage(fileName="background.png",
                                              x=(self.WINDOW_WIDTH / 2),
                                              y=(self.WINDOW_HEIGHT / 2))
     self.card_back = graphics.GraphicsImage(fileName="back.png",
                                             x=636,
                                             y=352)
     self.ObjectsOnScreen = []
     self.win = graphics.GraphicsWindow(width=self.WINDOW_WIDTH,
                                        height=self.WINDOW_HEIGHT)
     self.canvas = self.win.canvas()
     self.poker = TexasHoldEm(Player, Dealer, GameRules)
     self.player = Player
     self.dealer = Dealer
     self.gamerules = GameRules
     self.bCheckStats = True  #Temporary
__author__ = 'Andrew'
import graphics

win = graphics.GraphicsWindow(700, 700)
canvas = win.canvas()

win.wait()
Exemplo n.º 3
0
__author__ = 'Sbuper'
__author__ = 'Sbuper'
import graphics
userColor = input("Color?")
color1 = "black"
color2 = "black"
win = graphics.GraphicsWindow(600, 600)
canvas = win.canvas()

if len("userColor") % 2 == 0:
    color1 = userColor
else:
    color2 = userColor

canvas.setColor(color2)
canvas.drawOval(100, 100, 400, 400)

canvas.setColor(color1)
canvas.drawOval(150, 150, 300, 300)

canvas.setColor(color2)
canvas.drawOval(175, 175, 250, 250)

win.wait()
Exemplo n.º 4
0
 def openGraph(self):
     self.GraphicsWindow = graphics.GraphicsWindow(self)
     self.GraphicsWindow.show()
Exemplo n.º 5
0
__author__ = 'Andrew'
import graphics

numCircles = int(input("User, how many circles?"))
win = graphics.GraphicsWindow(1000, 1000)
canvas = win.canvas()
for y in range(0, 16, 1):
    for x in range(1, numCircles, 1):
        if (x % 2 == 0):
            canvas.setColor("green")
        else:
            canvas.setColor("red")
        canvas.drawRect(x * 50, y * 50, 50, 50)

win.wait()
Exemplo n.º 6
0

number = int(input("Enter n : "))
return_val = make_matrix(number)
for i in return_val:
    print('-----'*number)
    for j in i:
        print('|', end=' ')
        if len(str(j)) == 1:
            j = str(j)
            j = ' ' + j
        print(j, end=' ')
    print('|')
print('-----'*number)

win = graphics.GraphicsWindow()
win.setTitle('magic_square')
line = number * 50
win.canvas.setHeight(line)
win.canvas.setWidth(line)
x = line / number
y = 0
z = 0
xyz = 0
for j in range(number):
    y = 0
    for i in range(number):
        win.canvas.drawRect(y, z, x, x)
        win.canvas.drawText(y+(x/2.5), z+(x/2.5), return_val[j][i])
        y += x
    z += x