Comment programmer pierre-feuille-ciseaux ?
joueur, ordi est un nombre
noms est un tableau
noms vaut ['Pierre', 'Feuille', 'Ciseaux']
choisir noms dans joueur
ordi vaut hasard(1, 3)
affiche 'Ordinateur : ' + noms[ordi - 1]
si joueur = ordi alors
affiche 'Égalité'
sinon si (joueur = 1 et ordi = 3) ou (joueur = 2 et ordi = 1) ou (joueur = 3 et ordi = 2) alors
affiche 'Gagné !'
sinon
affiche 'Perdu…'
fin si