Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python gambling machine

import play
import random 

play.screen.width = 800
play.screen.height = 610

#_______________
play.new_box(color='yellow', x=-119, y=0, width=100, height=200, border_color='black', border_width=5, angle=0, transparency=100, size=100)
play.new_box(color='yellow', x=10, y=0, width=100, height=200, border_color='black', border_width=5, angle=0, transparency=100, size=100)
play.new_box(color='yellow', x=147, y=0, width=100, height=200, border_color='black', border_width=5, angle=0, transparency=100, size=100)
#______________
#páka
play.new_box(color='black', x=300, y=0, width=50, height=167, border_color='black', border_width=5, angle=0, transparency=100, size=100)
paka = play.new_circle(color='red', x=300, y=61, radius=100, border_color='black', border_width=1, transparency=100, size=37, angle=0)
#_______________

pole1 = play.new_text(words='', x=12, y=0, font=None, font_size=50, color='black', angle=0, transparency=100, size=200)
pole2 = play.new_text(words='', x=-117, y=0, font=None, font_size=50, color='black', angle=0, transparency=100, size=200)
pole3 = play.new_text(words='', x=148, y=0, font=None, font_size=50, color='black', angle=0, transparency=100, size=200)
#_______________
play.new_text(words='Výherní Automat', x=10, y=250, font=None, font_size=50, color='blue', angle=0, transparency=100, size=100)
#____________
vyhra = play.new_text(words='', x=10, y=-160, font=None, font_size=50, color='green', angle=0, transparency=100, size=100)

def generator () :
    pole1.words = random.randint (0, 9)
    pole2.words = random.randint (0, 9)
    pole3.words = random.randint (0, 9)
    if pole1.words == pole2.words and pole1.words== pole3.words :
        vyhra.words = "Vyhrál jsi!"
    else :
        vyhra.words = "Prohrál jsi!"
        


@play.repeat_forever
def pakaY () :
    if paka.is_clicked :
        generator ()
        if paka.y == 61 :
            paka.y = -60
        else:
            paka.y = 61
                


play.start_program()
Comment

PREVIOUS NEXT
Code Example
Python :: django python get more commands paramaters 
Python :: matplotlib no gui 
Python :: myPYmenu 
Python :: how to rub softwares using python 
Python :: create layer file arcpy 
Python :: how can i get the n values by space separated with condition in python 
Python :: kite order syntax 
Python :: bagging algorithm 
Python :: fecthone 
Python :: looping through the dict. and return the key with the highest value 
Python :: Customizing multiple plots in the same figure 
Python :: pandas to csv if no already present 
Python :: dropdown menu with selenium python 
Python :: negate all elements of a list 
Python :: how to add other categories in django admin template 
Python :: Create multiple lists with defined shape filled with 0 
Python :: How to draw a Ninja Design using python turtle 
Python :: filter parent based on related child name values 
Python :: how to set beutfull tkinter button 
Python :: qubesos 
Python :: passport parsing python 
Python :: mike tyson peso pesado 
Python :: connect elasticsearch cloud with python terminal 
Python :: how to convert variable in Python ? 
Python :: extract specific tuple values from two different keys from nested dictionary 
Python :: table and amorization charts using tkinter 
Python :: two labels on one axis python 
Python :: arrotondamento python 
Python :: convert excel cellname to index python 
Python :: get the factorial of a number on python 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =