From 2a320a4e5bf065786e77e8d396517cc4d2386466 Mon Sep 17 00:00:00 2001
From: BellCodeEditor <bellcode_dev@bell.ai>
Date: Sun, 12 Mar 2023 16:37:11 +0800
Subject: [PATCH] auto save

---
 diy1.py | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/diy1.py b/diy1.py
index 868c0ff..fd234dd 100644
--- a/diy1.py
+++ b/diy1.py
@@ -1,19 +1,20 @@
 import random
-player=input("玩家出拳:")
-print("玩家出拳:"+player)
-h=["剪刀","石头","布"]
-computer=random.choice(h)
-print("计算机出拳"+computer)
-if player in h:
-    if player==computer:
-        print("平局")
-    elif player=="石头"and computer=="剪刀":
-        print("恭喜,你赢了")
-    elif player=="剪刀"and computer=="布":
-        print("恭喜,你赢了")
-    elif player=="布"and computer=="石头":
-        print("恭喜你,你赢了")
+while True:
+    player=input("玩家出拳:")
+    print("玩家出拳:"+player)
+    h=["剪刀","石头","布"]
+    computer=random.choice(h)
+    print("计算机出拳"+computer)
+    if player in h:
+        if player==computer:
+            print("平局")
+        elif player=="石头"and computer=="剪刀":
+            print("恭喜,你赢了")
+        elif player=="剪刀"and computer=="布":
+            print("恭喜,你赢了")
+        elif player=="布"and computer=="石头":
+            print("恭喜你,你赢了")
+        else:
+            print("很遗憾,你输了")
     else:
-        print("很遗憾,你输了")
-else:
-    print("输入错误")
+        print("输入错误")
--
libgit2 0.25.0