-1
바위 종이 가위 코드. 임의의 하나를 선택하고 사용자 inputed 선택에 넣어 가정, 때로는 작동하지만 그것은 변경 동일해야 같은 가능성에 다른 사람은 당신은 결코 따기되지엘프가 엉망이 된 프로그램
import random
def one_game():
score_bot = 0
score_player = 0
a = ["rock", "paper", "scissors"]
UI = raw_input('(enter your choice rock, paper, or scissors)')
print(random.choice(a))
if (random.choice(a)) == (UI):
print ('Tie')
score_bot+1
score_player+1
elif 'rock' in (UI) and 'scissors' in (random.choice(a)):
print ('You win!')
score_player+1
elif 'rock' in (UI) and 'paper' in (random.choice(a)):
print ('You lose!')
score_bot+1
elif 'paper' in (UI) and 'scissors' in (random.choice(a)):
print ('You lose!')
score_bot+1
elif 'paper' in (UI) and 'rock' in (random.choice(a)):
print ('You win!')
score_player+1
elif 'scissors' in (UI) and 'rock' in (random.choice(a)):
print ('You lose!')
score_bot+1
elif 'scissors' in (UI) and 'paper' in (random.choice(a)):
print ('You win!')
score_player+1
print (score_player)
print (score_bot)
if (score_bot) > (score_player):
print ('bot wins!')
elif (score_bot) < (score_player):
print ('Player wins!')
와 모든 미래
random.choice(a)
를 대체? 너는 무엇을 기대하고 있니? –