Python Forum
[PyGame] Rock,paper,scissors Game(beginner)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] Rock,paper,scissors Game(beginner)
#11
GAME UPDATE
Can anyone guide me of how to fix the error that im having of, trying to end the game after 3 turns and telling the users that they both choose the same thing?

player = input("whats your name: ")
player1 = input("whats your name: ")

guess_same=[]

def game():
	choose= input(player+ " choose rock, paper or scissor?: ")
	choose1 = input(player1+ " choose rock, paper or scissor?: ")
	for turn in range(4):
		print("Turn", turn+1)
		if choose == "rock" and choose1 =="scissor":
			print(player+" won")
		elif choose == "paper" and choose1 =="rock":
			print(player+ " won")
		elif choose == "scissor" and choose1 =="paper":
			print(player+ " won")
		elif choose1 == "rock" and choose =="scissor":
			print(player1 +" won")
		elif choose1 == "paper" and choose == "rock":
			print(player1 +" won")
		elif choose1 == "scissor" and choose == "paper":
			print(player1+" won")
		#Getting an error of 'list indices must be integers or slices,not str'
		elif guess_same[choose][choose1]=="rock":
			print("youve guessed that already")
		else:
			print("you need to choose one of the options")
		#Ending the game after 3 turns
		if turn == 3:
			print("Game over")
			break
		game()
game()
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Rock/Paper/Scissors Game 1 abscorpy 6 3,727 Dec-01-2020, 10:08 PM
Last Post: metulburr
  randomization code in rock, paper, scissors cel 4 2,629 May-28-2020, 08:48 PM
Last Post: cel
  rock paper scissors game abscorpy 8 4,407 Feb-14-2019, 07:20 PM
Last Post: abscorpy
  Rock Paper Scissors Game, I need help. extraguac 2 2,483 Feb-14-2019, 04:34 AM
Last Post: extraguac

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020