Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. hand = ["グー", "チョキ", "パー"]
  5. judge = {
  6. (0,0):"あいこ", (0,1):"勝ち", (0,2):"負け",
  7. (1,0):"負け", (1,1):"あいこ", (1,2):"勝ち",
  8. (2,0):"勝ち", (2,1):"負け", (2,2):"あいこ", }
  9. #(自分の手,相手の手):対戦結果
  10.  
  11. player = int(input("あなたは何を出しますか? 0:グー, 1:チョキ 2:パー :"))
  12. rival = 0
  13.  
  14. print("あなたは", hand[player], "である")
  15. print("相手は", hand[rival], "である")
  16.  
  17. print("試合結果は", judge[(player, rival)], "!")
  18.  
  19. print("おわり")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement