Add if and three more times. In each if-statement test if the player chose "scissors"…
- User
Add if and three more times. In each if-statement test if the player chose "scissors" and the computer chose "rock", "paper", or "scissors". Add Set Text indented under each if-statement. Change the string in each to "Computer wins!" , "Player wins!" or "Tie game!" depending on who won #1 starting point player = codesters.Sprite("cat") player.go_to(-100, -75)
computer = codesters.Sprite("computer") computer.go_to(125, -75)
#decisions through the player choice = player.ask("Choose rock, paper, or scissors.")
if choice == "rock": sprite = codesters.Sprite("rock") if choice == "paper": sprite = codesters.Sprite("paper") if choice == "scissors": sprite = codesters.Sprite("scissors")
player.say("I choose " + choice) sprite.go_to(-125, 140)
#Decisions throughout the time for rock paper or scissors #easier things through both random_choice = random.randint(1,3)
if random_choice == 1: sprite = codesters.Sprite("rock") computer_choice = "rock" if random_choice == 2: sprite = codesters.Sprite("paper") computer_choice = "paper" if random_choice == 3: sprite = codesters.Sprite("scissors") computer_choice = "scissors"
computer.say("I choose " + computer_choice) sprite.go_to(125, 140)
sprite = codesters.Text("text", x, y)
result = codesters.Text("Hello up here.", 0, 200) if choice == "rock" and computer_choice == "rock": pass # delete after adding indented code result.set_text("tie game") if choice == "rock" and computer_choice == "paper": pass # delete after adding indented code result.set_text("Computer wins") if choice == "rock" and computer_choice == "scissors": pass # delete after adding indented code result.set_text("Player wins!NICE JOB PAL") if choice == "paper" and computer_choice == "rock": pass # delete after adding indented code result.set_text("Player wins WWWW!") if choice == "paper" and computer_choice == "paper": pass # delete after adding indented code result.set_text("Tie Game!") if choice == "paper" and computer_choice == "scissors": pass # delete after adding indented code result.set_text("Computer wins!")
- Assistant
#1 Add if and three more times. In each if-statement test if the player chose "scissors" and the computer chose "rock", "paper", or "scissors". #2 Add Set Text indented under each if-statement. Change the string in each to "Computer wins!" , "Player wins!" or "Tie game!" depending on who won
player = codesters.Sprite("cat") player.go_to(-100, -75)
computer = codesters.Sprite("computer") computer.go_to(125, -75)
- User
sprite = codesters.Text("text", x, y)
result = codesters.Text("Hello up here.", 0, 200) if choice == "rock" and computer_choice == "rock": pass # delete after adding indented code result.set_text("tie game") if choice == "rock" and computer_choice == "paper": pass # delete after adding indented code result.set_text("Computer wins") if choice == "rock" and computer_choice == "scissors": pass # delete after adding indented code result.set_text("Player wins!NICE JOB PAL") if choice == "paper" and computer_choice == "rock": pass # delete after adding indented code result.set_text("Player wins WWWW!") if choice == "paper" and computer_choice == "paper": pass # delete after adding indented code result.set_text("Tie Game!") if choice == "paper" and computer_choice == "scissors": pass # delete after adding indented code result.set_text("Computer wins!") indented under each if-statement. Change the string in each to "Computer wins!" , "Player wins!" or "Tie game!" depending on who won. Add if and three more times. In each if-statement test if the player chose "scissors" and the computer chose "rock", "paper", or "scissors"
- Assistant
player = codesters.Sprite("cat") player.go_to(-100, -75)
computer = codesters.Sprite("computer") computer.go_to(125, -75)
#decisions through the player choice = player.ask("Choose rock, paper, or scissors.")
if choice == "rock": sprite = codesters.Sprite("rock") if choice == "paper": sprite = codesters.Sprite("paper") if choice == "scissors": sprite = codesters.Sprite("scissors")
player.say("I choose " + choice) sprite.go_to(-125, 140)
#Decisions throughout the time for rock paper or scissors #easier things through both random_choice = random.randint(1,3)
if random_choice == 1: sprite = codesters.Sprite("rock") computer_choice = "rock" if random_choice == 2: sprite = codesters.Sprite("paper") computer_choice = "paper" if random_choice == 3: sprite = codesters.Sprite("scissors") computer_choice = "scissors"
- User
hi
- Assistant
Hello! How can I assist you today?