set user_score to 0set cpu_score to 0repeat set rps_list to {"Rock", "Paper", "Scissors"} set the list_count to the count of rps_list set pick to random number from 1 to list_count set cpu_choice to item pick of rps_list as string set rps_dialog to display dialog "Rock, Paper, Scissors?" buttons {"Rock", "Paper", "Scissors"} set user_choice to (button returned of rps_dialog) as string display dialog "Rock..." giving up after 1 display dialog "Paper..." giving up after 1 display dialog "Scissors!" giving up after 1 if user_choice is equal to cpu_choice then display dialog "Player chose: " & user_choice & return & "Computer chose: " & cpu_choice & return & return & "Tie Game" else if user_choice is equal to "Rock" and cpu_choice is equal to "Paper" then display dialog "Player chose: " & user_choice & return & "Computer chose: " & cpu_choice & return & return & "You lose!" set cpu_score to cpu_score + 1 else if user_choice is equal to "Rock" and cpu_choice is equal to "Scissors" then display dialog "Player chose: " & user_choice & return & "Computer chose: " & cpu_choice & return & return & "You win!" set user_score to user_score + 1 else if user_choice is equal to "Paper" and cpu_choice is equal to "Scissors" then display dialog "Player chose: " & user_choice & return & "Computer chose: " & cpu_choice & return & return & "You lose!" set cpu_score to cpu_score + 1 else if user_choice is equal to "Paper" and cpu_choice is equal to "Rock" then display dialog "Player chose: " & user_choice & return & "Computer chose: " & cpu_choice & return & return & "You win!" set user_score to user_score + 1 else if user_choice is equal to "Scissors" and cpu_choice is equal to "Rock" then display dialog "Player chose: " & user_choice & return & "Computer chose: " & cpu_choice & return & return & "You lose!" set cpu_score to cpu_score + 1 else if user_choice is equal to "Scissors" and cpu_choice is equal to "Paper" then display dialog "Player chose: " & user_choice & return & "Computer chose: " & cpu_choice & return & return & "You win!" set user_score to user_score + 1 end if set play_again to display dialog "Play again?" buttons {"Yes", "No"} set again_choice to button returned of play_again if again_choice is not equal to "Yes" then if user_score is greater than cpu_score then display dialog "Final Score" & return & "You: " & user_score & return & "Computer: " & cpu_score & return & "You are the winner!" exit repeat else if user_score is less than cpu_score then display dialog "Final Score" & return & "You: " & user_score & return & "Computer: " & cpu_score & return & "You are the loser!" exit repeat else if user_score is equal to cpu_score then display dialog "Final Score" & return & "You: " & user_score & return & "Computer: " & cpu_score & return & "Looks like a tie game!" exit repeat end if end ifend repeat
display dialog (some item of {"Heads", "Tails"}