@ -47,13 +47,13 @@ class Machine_a_sous:
print ( f " \n Il vous reste { self . argent } jetons, et il reste { self . bank } jetons dans le bac de la machine. \n " )
print ( f " \n Il vous reste { self . argent } jetons, et il reste { self . bank } jetons dans le bac de la machine. \n " )
class Gui :
class Game_g ui :
def __init__ ( self ) :
def __init__ ( self ) :
self . machine = Machine_a_sous ( )
self . machine = Machine_a_sous ( )
self . bg_color = ' #777777 '
self . bg_color = ' #777777 '
self . fen = tk . Tk ( )
self . fen = tk . Tk ( )
self . fen . geometry ( ' 1350x9 00' )
self . fen . geometry ( ' 900x6 00' )
self . fen . title ( ' Bellagio ' )
self . fen . title ( ' Bellagio ' )
self . fen . config ( background = self . bg_color )
self . fen . config ( background = self . bg_color )
self . name_frame = [ ' banque ' , ' mise ' , ' argent ' ]
self . name_frame = [ ' banque ' , ' mise ' , ' argent ' ]
@ -62,25 +62,36 @@ class Gui:
self . info = [ tk . Label ( self . frame [ i ] , background = self . bg_color , text = self . name_info [ i ] , width = 15 , font = ( ' Helvetica ' , 36 , ' bold ' ) ) for i in range ( 3 ) ]
self . info = [ tk . Label ( self . frame [ i ] , background = self . bg_color , text = self . name_info [ i ] , width = 15 , font = ( ' Helvetica ' , 36 , ' bold ' ) ) for i in range ( 3 ) ]
self . column = [ 1 , 2 , 5 ]
self . column = [ 1 , 2 , 5 ]
<< << << < HEAD
for i in range ( 3 ) :
for i in range ( 3 ) :
if i != 1 :
if i != 1 :
self . frame [ i ] . grid ( column = self . column [ i ] , row = 1 , padx = 12 )
self . frame [ i ] . grid ( column = self . column [ i ] , row = 1 , padx = 12 )
else :
else :
self . frame [ i ] . grid ( columnspan = 3 , column = self . column [ i ] , row = 1 )
self . frame [ i ] . grid ( columnspan = 3 , column = self . column [ i ] , row = 1 )
self . info [ i ] . grid ( )
self . info [ i ] . grid ( )
== == == =
self . bank = tk . Label ( self . fen , background = self . bg_color , text = self . machine . bank , width = 4 , padx = 90 , font = ( ' Helvetica ' , 36 , ' bold ' ) )
self . bank . grid ( column = 1 , row = 1 )
self . argent = tk . Label ( self . fen , background = self . bg_color , text = self . machine . argent , width = 3 , padx = 140 , font = ( ' Helvetica ' , 36 , ' bold ' ) )
self . argent . grid ( column = 5 , row = 1 )
self . mise = tk . Label ( self . fen , width = 2 , background = self . bg_color , text = 0 , font = ( ' Helvetica ' , 36 , ' bold ' ) )
self . mise . grid ( column = 3 , row = 1 )
>> >> >> > 3 ce21be69dc251d54b7c491b4b2a0c8035f76778
self . entry_mise = tk . Entry ( self . fen , width = 50 )
self . entry_mise = tk . Entry ( self . fen , width = 50 )
self . entry_mise . insert ( 0 , ' Entrez votre mise entre 0 et 100 ' )
self . entry_mise . insert ( 0 , ' Entrez votre mise entre 0 et 100 ' )
self . entry_mise . grid ( columnspan = 3 , column = 2 , row = 3 )
self . entry_mise . grid ( columnspan = 3 , column = 2 , row = 3 )
self . rouleaus = [ tk . Label ( self . fen , padx = 65 , pady = 300 , text = 0 , background = self . bg_color , fg = ' #db0000 ' , font = ( ' Helvetica ' , 36 , ' bold ' ) ) for i in range ( 3 ) ]
self . rouleaus = [ tk . Label ( self . fen , padx = 3 5, pady = 2 00, text = 0 , background = self . bg_color , fg = ' #db0000 ' , font = ( ' Helvetica ' , 36 , ' bold ' ) ) for i in range ( 3 ) ]
for i in range ( 3 ) :
for i in range ( 3 ) :
self . rouleaus [ i ] . grid ( column = i + 2 , row = 2 )
self . rouleaus [ i ] . grid ( column = i + 2 , row = 2 )
self . fen . bind ( ' <Return> ' , self . game )
self . fen . bind ( ' <Return> ' , self . play )
self . fen . mainloop ( )
self . fen . mainloop ( )
def game ( self , event ) :
def play ( self , event ) :
regles ( )
regles ( )
self . machine . mise = int ( self . entry_mise . get ( ) )
self . machine . mise = int ( self . entry_mise . get ( ) )
while self . machine . saisie ( ) == False :
while self . machine . saisie ( ) == False :
@ -102,6 +113,7 @@ class Gui:
class Menu_gui :
class Menu_gui :
def __init__ ( self ) :
def __init__ ( self ) :
self . bg_color = ' #777777 '
self . bg_color = ' #777777 '
<< << << < HEAD
self . fen = tk . Tk ( )
self . fen = tk . Tk ( )
self . fen . geometry ( ' 900x600 ' )
self . fen . geometry ( ' 900x600 ' )
@ -117,6 +129,29 @@ class Menu_gui:
self . fen . mainloop ( )
self . fen . mainloop ( )
== == == =
self . fen = tk . Tk ( )
self . fen . geometry ( ' 900x600 ' )
self . fen . title ( ' Bellagio ' )
self . fen . config ( background = self . bg_color )
self . pres = tk . Label ( self . fen , text = ' Bienvenue au casino ' , font = ( ' Helvetica ' , 36 , ' bold ' ) , background = self . bg_color )
self . pres . pack ( )
self . regle = tk . Label ( self . fen , text = regles ( ) , font = ( ' Helvetica ' , 16 , ' bold ' ) , background = self . bg_color )
self . regle . pack ( )
self . fen . mainloop ( )
def regles ( ) :
text = " La machine 1000 jetons au départ. \n Si les trois chiffres sont des 9, vous gagnez tout le bac! \n Si vous tombez sur 3 chiffres identiques différents de 9, alors vous gagnez 6 fois votre mise. \n Si vous avez 2 identiques, alors vous gagnez 3 fois la mise que vous avez mis. \n Si aucun chiffres ne sont identiques vous ne gagnez rien. "
return text
# gui = Game_gui()
menu = Menu_gui ( )
>> >> >> > 3 ce21be69dc251d54b7c491b4b2a0c8035f76778
def regles ( ) :
def regles ( ) :