Deutsch   English   Français   Italiano  
<-eydneEPP5h83uD8nZ2dnUU798zNnZ2d@giganews.com>

View for Bookmarking (what is this?)
Look up another Usenet article

X-Received: by 2002:a05:600c:35c2:: with SMTP id r2mr18800998wmq.26.1635599329529;
        Sat, 30 Oct 2021 06:08:49 -0700 (PDT)
MIME-Version: 1.0
Path: ...!buffer2.nntp.ams1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 30 Oct 2021 08:08:49 -0500
Newsgroups: fr.comp.lang.python
Subject: Programme tkinter
X-poster: PEAR::Net_NNTP v1.5.0 (stable)
From: pwl13 <nospam_travailpaulwillermoz@gmail.com.invalid>
Organization: !No_Organization!
Message-ID: <-eydneEPP5h83uD8nZ2dnUU798zNnZ2d@giganews.com>
Date: Sat, 30 Oct 2021 08:08:49 -0500
Lines: 62
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-fcrc25lICa6V1cd1J3gEtLaVwW+A3Ir4wB4Ejqq/yqkUKt0VrvPQG1rk1snDudwpMek3C2rnSXKm99f!zisXG7ax6S9ST+a3LTW4kFqCkuqPqlpo7bp6YNO7M13a6uOkoUM153D7P8KxcZhIFonKf0i1DVl4
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Lines: 59
X-Original-Bytes: 2544
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
Bytes: 2961

Bonjour, à tous.
J'envoie ce message pour savoir si vous pouviez m'aider avec mon programme, je
dois écrire un programme tkinter pour jouer à Pierre feuille ciseaux avec
l'ordinateur.
J'aimerais mettre 3 boutons (pierre, feuille, ciseaux) ainsi qu'un compteur de
point pour le joueur et pour l'ordinateur et en fin un affichage pour nous dire
si on a gagné ou perdu.
 Voici ce que j'ai déjà fait :

from tkinter import*

pierre1 = 1
feuille2 = 2
ciseaux3 = 3


def choix_ordi():
    a=randit (1,3)
if a == 1:
    result = "pierre"
elif a == 2:
    result = "feuille"
elif a == 3:
    result = "ciseaux"


def choix_pierre():
    if choix_ordi == 1:
        print('égalité')
    if choix_ordi == 2:
        print ('vous avez perdu')
    if choix_ordi == 3:
        print ('vous avez gagné')
        
def choix_feuille():
    if choix_ordi == 1:
        print('vous avez gagné')
    if choix_ordi == 2:
        print ('égalité')
    if choix_ordi == 3:
        print ('vous avez perdu')
        
def choix_ciseaux():
    if choix_ordi == 1:
        print('vous avez perdu')
    if choix_ordi == 2:
        print ('vous avez gagné')
    if choix_ordi == 3:
        print ('égalité')





fenetre = Tk()
fenetre. geometry('500*300')

pierre_bouton = button(fenetre, texte='Pierre',command=choix_pierre)
feuille_bouton = button(fenetre, texte='Feuille',command=choix_feuille)
ciseaux_bouton = button(fenetre, texte='Ciseaux',command=choix_ciseaux)

ok.pack()
fenetre.mainloop()