Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- display dialog "Bienvenue au jeu du Pierre feuille ciseaux" with title "Chifoumi" buttons {"Annuler", "Commencer"} default button 2
- set mode to display dialog "Choisissez un mode de jeu:" with title "Chifoumi" buttons {"🤖 Jouer avec un robot", "👫 Jouer à deux"}
- if button returned of mode is "👫 Jouer à deux" then
- set j1_score to 0
- set j2_score to 0
- set manche_nbr to 1
- set manches_cmd to display dialog "Combien de manches ?" default answer "3" buttons ("OK") default button 1
- set nbr_manches to text returned of manches_cmd
- set j1_cmd to display dialog "Entrez le nom du joueur n°1 :" default answer "" with title "Chifoumi" buttons ("Valider") default button 1
- set j1_n to text returned of j1_cmd
- set j2_cmd to display dialog "Entrez le nom du joueur n°2 :" default answer "" with title "Chifoumi" buttons ("Valider") default button 1
- set j2_n to text returned of j2_cmd
- repeat nbr_manches times
- display dialog j1_n & " et " & j2_n & ", La manche " & manche_nbr & " va commencer !" with title "Chifoumi"
- display dialog j1_n & " commence !" with title "Chifoumi" buttons ("Démarrer") default button 1
- set j1_di to display dialog j1_n & ", choisis pierre, feuille, ou ciseaux" with title "Chifoumi" buttons {"💎 Pierre", "🍁 Feuille", "✂️ Ciseaux"}
- set j1_ch to button returned of j1_di
- display dialog j2_n & ", à ton tour !" with title "Chifoumi" buttons ("Démarrer") default button 1
- set j2_di to display dialog j2_n & ", choisis pierre, feuille, ou ciseaux" with title "Chifoumi" buttons {"💎 Pierre", "🍁 Feuille", "✂️ Ciseaux"}
- set j2_ch to button returned of j2_di
- display dialog "OK !" with title "Chifoumi" buttons ("Voir les résultats") default button 1
- display notification "Calcul des résultats..." with title "Chifoumi" sound name "Purr"
- delay 1
- if j1_ch = j2_ch then set results to "Match nul !"
- if j1_ch = "💎 Pierre" and j2_ch = "🍁 Feuille" then set results to j2_n & " gagne !"
- if j1_ch = "💎 Pierre" and j2_ch = "✂️ Ciseaux" then set results to j1_n & " gagne !"
- if j1_ch = "🍁 Feuille" and j2_ch = "💎 Pierre" then set results to j1_n & " gagne !"
- if j1_ch = "🍁 Feuille" and j2_ch = "✂️ Ciseaux" then set results to j2_n & " gagne !"
- if j1_ch = "✂️ Ciseaux" and j2_ch = "🍁 Feuille" then set results to j1_n & " gagne !"
- if j1_ch = "✂️ Ciseaux" and j2_ch = "💎 Pierre" then set results to j2_n & " gagne !"
- display dialog j1_n & " : " & j1_ch & "
- " & j2_n & " : " & j2_ch & "
- ★ " & results & " ★" buttons ("OK") with title "Résultats" default button 1
- if results = j1_n & " gagne !" then set j1_score to j1_score + 1
- if results = j2_n & " gagne !" then set j2_score to j2_score + 1
- set manche_nbr to manche_nbr + 1
- end repeat
- if j1_score = j2_score then set score_res to "Match nul !"
- if j1_score < j2_score then set score_res to j2_n & " Gagne !"
- if j2_score < j1_score then set score_res to j1_n & " Gagne !"
- display dialog j1_n & " : " & j1_score & " Points
- " & j2_n & " : " & j2_score & " Points
- ★ " & score_res & " ★" buttons ("OK") with title "Résultats" default button 1
- end if
- if button returned of mode is "🤖 Jouer avec un robot" then
- set j1_n to "🤖 Robot"
- set j2_cmd to display dialog "Entrez votre nom :" default answer "" with title "Chifoumi" buttons ("Valider") default button 1
- set j2_n to text returned of j2_cmd
- display dialog j1_n & " et " & j2_n & ", Le jeu va commencer !" with title "Chifoumi"
- display dialog j2_n & " commence !" with title "Chifoumi" buttons ("Démarrer") default button 1
- set j2_di to display dialog j2_n & ", choisis pierre, feuille, ou ciseaux" with title "Chifoumi" buttons {"💎 Pierre", "🍁 Feuille", "✂️ Ciseaux"}
- set j2_ch to button returned of j2_di
- display dialog "au tour du robot !" with title "Chifoumi" buttons ("Démarrer") default button 1
- display notification "Veuillez patienter..." with title "🤖 le robot choisit..." sound name "Purr"
- random number from 1 to 3
- set bot_nbr to result
- if bot_nbr = 1 then set j1_ch to "💎 Pierre"
- if bot_nbr = 2 then set j1_ch to "🍁 Feuille"
- if bot_nbr = 3 then set j1_ch to "✂️ Ciseaux"
- delay 1
- display dialog "OK !" with title "Chifoumi" buttons ("Voir les résultats") default button 1
- display notification "Calcul des résultats..." with title "Chifoumi" sound name "Purr"
- delay 1
- if j1_ch = j2_ch then set results to "Match nul !"
- if j1_ch = "💎 Pierre" and j2_ch = "🍁 Feuille" then set results to j2_n & " gagne !"
- if j1_ch = "💎 Pierre" and j2_ch = "✂️ Ciseaux" then set results to j1_n & " gagne !"
- if j1_ch = "🍁 Feuille" and j2_ch = "💎 Pierre" then set results to j1_n & " gagne !"
- if j1_ch = "🍁 Feuille" and j2_ch = "✂️ Ciseaux" then set results to j2_n & " gagne !"
- if j1_ch = "✂️ Ciseaux" and j2_ch = "🍁 Feuille" then set results to j1_n & " gagne !"
- if j1_ch = "✂️ Ciseaux" and j2_ch = "💎 Pierre" then set results to j2_n & " gagne !"
- display dialog j1_n & " : " & j1_ch & "
- " & j2_n & " : " & j2_ch & "
- ★ " & results & " ★" buttons ("OK") with title "Résultats" default button 1
- end if
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement