Guest User

Untitled

a guest
Nov 20th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. # hw10.py
  2.  
  3. import random
  4. player1=input('1플레이어의 이름은? ')
  5. player2=input('2플레이어의 이름은? ')
  6. print(' ')
  7.  
  8. i, dice1, dice2 = 1, 0, 0
  9. while True:
  10. print(i, '라운드')
  11. dice=random.randint(1, 6)
  12. dice1+=dice
  13. print(player1, '는(은) %d가(이) 나왔습니다. 현재 위치: %d' %(dice, dice1))
  14. dice=random.randint(1, 6)
  15. dice2+=dice
  16. print(player2, '는(은) %d가(이) 나왔습니다. 현재위치: %d' %(dice, dice2))
  17. print(' ')
  18. if dice1>=30:
  19. print(i, '라운드만에', player1, '가(이) 이겼습니다.')
  20. break
  21. elif dice2>=30:
  22. print(i, '라운드만에', player2, '가(이) 이겼습니다.')
  23. break
  24. i+=1
Add Comment
Please, Sign In to add comment