简单,直接运行和看源码即可。
源码
import random
import time
# 你说我猜 emoji😀
class ThisGame():
def __init__(self):
self.guess_times = 0
self.play_times = 0
def play(self):
self.play_times += 1
self.true_number = random.randint(1, 100)
print("\n- - - - - - - - - - - - - - - - - - - - - \n")
print(f"第 {self.play_times} 轮游戏 " + "😘"*self.play_times)
print("猜出刚刚产生的数字 1-100😍 ")
guess_number = None
while(True):
guess_number = input()
while( not guess_number.isdecimal() ):
print("拜托别打字母😭")
guess_number = input()
guess_number = float(guess_number)
if self._tips(guess_number):
print("老天,你终于猜对了😉😉&#