Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- hand = ["グー", "チョキ", "パー"]
- judge = {
- (0,0):"あいこ", (0,1):"勝ち", (0,2):"負け",
- (1,0):"負け", (1,1):"あいこ", (1,2):"勝ち",
- (2,0):"勝ち", (2,1):"負け", (2,2):"あいこ", }
- #(自分の手,相手の手):対戦結果
- player = int(input("あなたは何を出しますか? 0:グー, 1:チョキ 2:パー :"))
- rival = 0
- print("あなたは", hand[player], "である")
- print("相手は", hand[rival], "である")
- print("試合結果は", judge[(player, rival)], "!")
- print("おわり")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement