Here is main.py:

from game import Game

if \_\_name\_\_ == '\_\_main\_\_':
 game = Game()
 game.run\_game()

game.py:

from human import Human
from ai import AI
from time import sleep

class Game():
 def run\_game(self):
 self.determine\_players()
 self.initiate\_players()
 while self.player1.score < 2 and self.player2.score < 2:
 self.play\_round()
 self.declare\_game\_winner()
 self.play\_again()
 
 def determine\_players(self):
 print("\nHow many human players would you like?")
 self.player\_number = input("Please enter 0, 1, or 2: ")
 while not (self.player\_number.isnumeric() and int(self.player\_number) in [0, 1, 2]):
 self.player\_number = input("Invalid input. Please enter either 0, 1, or 2: ")
 self.player\_number = int(self.player\_number)
 print ()
 
 def initiate\_players(self):
 if self.player\_number == 0:
 self.player1 = AI("AI 1")
 self.player2 = AI("AI 2")
 if self.player\_number == 1:
 self.player1 = Human("Player")
 self.player2 = AI("AI")
 if self.player\_number == 2:
 self.player1 = Human("Player 1")
 self.player2 = Human("Player 2")

 def play\_round(self):
 self.player1.choose\_gesture()
 self.player2.choose\_gesture()
 self.determine\_round\_winner()

 def determine\_round\_winner(self):
 # Probably a better way to do this whole thing. 
 # Not sure how though. Putting in every single combination seems annoying but unavoidable.
 result = (self.player1.gesture, self.player2.gesture)
 sleep(0.5)
 if self.player1.gesture == self.player2.gesture:
 print (f"This round is a draw!\n")
 # elif result in [("Rock", "Scissors"), ("Scissors", "Paper"), ("Paper", "Rock"), ("Rock, Lizard"), ("Lizard", "Spock"), ("Spock", "Scissors"), ("Scissors", "Lizard"), ("Lizard", "Paper"), ("Paper", "Spock"), ("Spock", "Rock")]:
 # Better formatting to break out into lines?
 elif result in [
 ("Rock", "Scissors"), 
 ("Scissors", "Paper"), 
 ("Paper", "Rock"), 
 ("Rock, Lizard"), 
 ("Lizard", "Spock"), 
 ("Spock", "Scissors"), 
 ("Scissors", "Lizard"), 
 ("Lizard", "Paper"), 
 ("Paper", "Spock"), 
 ("Spock", "Rock")]:
 self.player1.increase\_score()
 print (f"{self.player1.name} wins this round!\n")
 else:
 self.player2.increase\_score()
 print (f"{self.player2.name} wins this round!\n")
 
 def declare\_game\_winner(self):
 # if (self.player1.score == 2):
 # print (f"{self.player1.name} wins the game!")
 # else:
 # print (f"{self.player2.name} wins the game!") 
 winner = self.player1.name if self.player1.score == 2 else self.player2.name
 # Found out about ternary operators, trying them out.
 print(f"The winner is {winner}!")
 
 def play\_again(self):
 again = input("Would you like to play again? (y/n): ")
 while not again in ['y', 'n']:
 again = input("Please enter either y or n: ")
 if again == 'y':
 self.run\_game()
 # Does this lead to a stack overflow eventually? 
 # If someone chooses yes 10 times, are all the other instances still waiting to close?

human.py:
from player import Player
from time import sleep
from getpass import getpass

class Human(Player):
 def \_\_init\_\_(self, name):
 super().\_\_init\_\_()
 self.name = name

 def choose\_gesture(self):
 print("\n1: Rock\n2: Paper\n3: Scissors\n4: Lizard\n5: Spock")
 self.gesture = input("Please choose a gesture (1-5): ")
 while not (self.gesture.isnumeric() and int(self.gesture) in [1, 2, 3, 4, 5]):
 self.gesture = input("Invalid input. Please enter an integer between 1 and 5: ")
 self.gesture = self.gesture\_options[int(self.gesture)-1]# Adjusts down, so players don't have to deal with 0 indexing
 sleep(0.5)
 print (f"{self.name} throws {self.gesture}.")

 # Is there a way to blank the input? Don't want other player to see.
 # If so, I'd have to adjust the print statement to come after both players have made their choices.
 # There is: getpass
 # Only makes sense to use in 2-human games though
 # Just replace input with getpass

ai.py:
import random
from player import Player
from time import sleep

class AI(Player):
 def \_\_init\_\_(self, name):
 super().\_\_init\_\_()
 self.name = name
 
 def choose\_gesture(self):
 self.gesture = self.gesture\_options[random.randint(0, 4)]
 sleep(0.5)
 print (f"{self.name} throws {self.gesture}.")

and finally, player.py:
class Player:
 def \_\_init\_\_(self): 
 self.score = 0
 self.gesture\_options = ["Rock", "Paper", "Scissors", "Lizard", "Spock"]
 
 def increase\_score(self):
 self.score += 1

Please tell me what you think the program does, and what I could change to make it more efficient.
다음은 main.py입니다:

게임에서 게임 가져 오기

if \_\_name\_\_ == '\_\_main\_\_':
 game = Game()
 game.run\_game()

game.py:

from human import Human
from ai import AI
from time import sleep

class Game():
 def run\_game(self):
 self.determine\_players()
 self.initiate\_players()
 self.player1.score < 2, self.player2.score < 2인 동안:
 self.play\_round()
 self.declare\_game\_winner()
 self.play\_again()
 
 def determine\_players(self):
 print("\n몇 명의 인간 플레이어를 원하십니까?")
 self.player\_number = input("0, 1, 2를 입력하세요: ")
 while not (self.player\_number.isnumeric() 및 int(self.player\_number) in [0, 1, 2]):
 self.player\_number = input("잘못된 입력입니다. 0, 1 또는 2 중 하나를 입력하세요: ")
 self.player\_number = int(self.player\_number)
 print ()
 
 def initiate\_players(self):
 if self.player\_number == 0:
 self.player1 = AI("AI 1")
 self.player2 = AI("AI 2")
 if self.player\_number == 1:
 self.player1 = Human("Player")
 self.player2 = AI("AI")
 if self.player\_number == 2:
 self.player1 = Human("플레이어 1")
 self.player2 = Human("Player 2")

 def play\_round(self):
 self.player1.choose\_gesture()
 self.player2.choose\_gesture()
 self.determine\_라운드\_승자()

 def determine\_round\_winner(self):
 # 아마도 이 모든 것을 수행하는 더 좋은 방법일 것입니다. 
 # 하지만 방법은 잘 모르겠습니다. 모든 조합을 입력하는 것은 귀찮지만 피할 수 없는 일인 것 같습니다.
 결과 = (self.player1.제스처, self.player2.제스처)
 sleep(0.5)
 if self.player1.gesture == self.player2.gesture:
 print (f"이번 라운드는 무승부입니다!\n")
 # elif 결과 [("바위", "가위"), ("가위", "종이"), ("종이", "바위"), ("바위, 리자드"), ("리자드", "스팍"), ("스팍", "가위"), ("가위", "리자드"), ("리자드", "종이"), ("종이", "스팍"), ("스팍", "바위")]:
 # 줄로 나누기 위한 더 나은 서식?
 엘리프 결과 [
 ("바위", "가위"), 
 ("가위", "종이"), 
 ("종이", "바위"), 
 ("바위, 도마뱀"), 
 ("도마뱀", "스팍"), 
 ("스팍", "가위"), 
 ("가위", "리자드"), 
 ("리자드", "종이"), 
 ("종이", "스팍"), 
 ("스팍", "바위")]:
 self.player1.increase\_score()
 print (f"{self.player1.name}이 이번 라운드에서 승리했습니다!\n")
 else:
 self.player2.increase\_score()
 print (f"{self.player2.name}이 이번 라운드에서 승리했습니다!\n")
 
 def declare\_game\_winner(self):
 # if (self.player1.score == 2):
 # print (f"{self.player1.name}이 게임에서 이겼습니다!")
 # else:
 # print (f"{self.player2.name}이 게임에서 승리했습니다!") 
 winner = self.player1.name if self.player1.score == 2 else self.player2.name
 # 삼항 연산자에 대해 알아보고 사용해 보았습니다.
 print(f"우승자는 {winner}입니다!")
 
 def play\_again(self):
 again = input("다시 플레이하시겠습니까? (y/n): ")
 동안 다시 ['y', 'n']에 있지 않습니다:
 again = input("y 또는 n 중 하나를 입력하세요: ")
 if again == 'y':
 self.run\_game()
 # 결국 스택 오버플로로 이어지나요? 
 # 누군가 yes를 10번 선택하면 다른 모든 인스턴스가 여전히 닫히기를 기다리나요?

human.py:
from player import Player
from time import sleep
from getpass import getpass

class Human(Player):
 def \_\_init\_\_(self, name):
 super().\_\_init\_\_()
 self.name = name

 def choose\_gesture(self):
 print("\n1: 바위\n2: 종이\n3: 가위\n4: 도마뱀\n5: 스팍")
 self.gesture = input("제스처 (1-5)를 선택하세요: ")
 while not (self.gesture.isnumeric() 및 int(self.gesture) in [1, 2, 3, 4, 5]):
 self.gesture = input("잘못된 입력입니다. 1에서 5 사이의 정수를 입력하세요: ")
 self.gesture = self.gesture\_options[int(self.gesture)-1]# 플레이어가 0 인덱싱을 처리할 필요가 없도록 아래로 조정합니다.
 sleep(0.5)
 print (f"{self.name} throws {self.gesture}.")

 # 입력을 비울 수 있는 방법이 있나요? 다른 플레이어가 보지 않기를 원합니다.
 # 그렇다면 두 플레이어가 모두 선택을 한 후에 나오도록 인쇄 문을 조정해야 합니다.
 # 있습니다: getpass
 # 하지만 2인 게임에서만 사용하는 것이 좋습니다.
 # 입력을 getpass로 대체하면 됩니다.

ai.py:
import random
에서 플레이어 가져 오기 플레이어
에서 시간에서 수면 가져 오기

class AI(Player):
 def \_\_init\_\_(self, name):
 super().\_\_init\_\_()
 self.name = name
 
 def choose\_gesture(self):
 self.gesture = self.gesture\_옵션[random.randint(0, 4)]
 sleep(0.5)
 print (f"{self.name} throws {self.gesture}.")

마지막으로, player.py입니다:
class Player:
 def \_\_init\_\_(self): 
 self.score = 0
 self.gesture\_옵션 = ["바위", "종이", "가위", "도마뱀", "스팍"]
 
 def increase\_score(self):
 self.score += 1

이 프로그램이 어떤 기능을 한다고 생각하는지, 더 효율적으로 만들기 위해 무엇을 바꿀 수 있는지 알려주세요.